jquery輪播圖插件使用方法詳解
本文實(shí)例為大家分享了jquery輪播圖插件使用案例,供大家參考,具體內(nèi)容如下

代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jQuery.js"></script>
<script type="text/javascript" src="carousel.js"></script>
<script type="text/javascript">
$(function(){
$(".carousel-content").carousel({
carousel : ".carousel",//輪播圖容器
indexContainer : ".img-index",//下標(biāo)容器
prev : ".carousel-prev",//左按鈕
next : ".carousel-next",//右按鈕
timing : 2000,//自動(dòng)播放間隔
animateTime : 700,//動(dòng)畫時(shí)間
autoPlay : true,//是否自動(dòng)播放 true/false
direction : "left",//滾動(dòng)方向 right/left
});
$(".carousel-content").hover(function(){
$(".carousel-prev,.carousel-next").fadeIn(300);
},function(){
$(".carousel-prev,.carousel-next").fadeOut(300);
});
$(".carousel-prev").hover(function(){
$(this).find("img").attr("src","img/left2.png");
},function(){
$(this).find("img").attr("src","img/left1.png");
});
$(".carousel-next").hover(function(){
$(this).find("img").attr("src","img/right2.png");
},function(){
$(this).find("img").attr("src","img/right1.png");
});
});
</script>
</head>
<body>
<div class="content">
<div class="a-content">
<div class="carousel-content">
<ul class="carousel">
<li><img src="img/1.jpg"></li>
<li><img src="img/2.jpg"></li>
<li><img src="img/3.jpg"></li>
<li><img src="img/4.jpg"></li>
<li><img src="img/5.jpg"></li>
</ul>
<ul class="img-index"></ul>
<div class="carousel-prev"><img src="img/left1.png"></div>
<div class="carousel-next"><img src="img/right1.png"></div>
</div>
</div>
</div>
</body>
</html>
精彩專題分享:jQuery圖片輪播 JavaScript圖片輪播 Bootstrap圖片輪播
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
jquery操作HTML5 的data-*的用法實(shí)例分享
從jQuery 1.4.3起, HTML 5 data- 屬性 將自動(dòng)被引用到j(luò)Query的數(shù)據(jù)對(duì)象中。也就是說雖然 data-* 是在html5 中的元素, 但是如果使用 jquery 1.4.3庫以上的.還是可以 在非HTML5的頁面或?yàn)g覽器里, 仍然可以使用.data(obj)方法來操作"data-*" 數(shù)據(jù).2014-08-08
jQuery 遍歷-nextUntil()方法以及prevUntil()方法的使用介紹
本篇文章介紹了,jQuery 遍歷-nextUntil()方法以及prevUntil()方法的使用。需要的朋友參考下2013-04-04
jquery 實(shí)現(xiàn)兩級(jí)導(dǎo)航菜單附效果圖
兩級(jí)導(dǎo)航菜單在網(wǎng)頁中非常實(shí)用,實(shí)現(xiàn)的方法也有很多,本文為大家介紹下使用jquery是如何實(shí)現(xiàn)的2014-03-03
jQuery簡(jiǎn)單入門示例之用戶校驗(yàn)demo示例
這篇文章主要介紹了jQuery簡(jiǎn)單入門示例之用戶校驗(yàn)demo示例,分析了基于jQuery的簡(jiǎn)單用戶校驗(yàn)功能相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2016-07-07
基于JQuery和DWR實(shí)現(xiàn)異步數(shù)據(jù)傳遞
這篇文章主要介紹了基于JQuery和DWR實(shí)現(xiàn)異步數(shù)據(jù)傳遞,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-10-10
jquery處理頁面彈出層查詢數(shù)據(jù)等待操作實(shí)例
這篇文章主要介紹了jquery處理頁面彈出層查詢數(shù)據(jù)等待操作,實(shí)例分析了jquery實(shí)現(xiàn)等待效果的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03

