jquery輪播圖插件使用方法詳解
更新時間:2020年07月31日 10:56:19 作者:taff
這篇文章主要為大家詳細(xì)介紹了jquery輪播圖插件的使用方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了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,//自動播放間隔
animateTime : 700,//動畫時間
autoPlay : true,//是否自動播放 true/false
direction : "left",//滾動方向 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圖片輪播
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
jQuery 遍歷-nextUntil()方法以及prevUntil()方法的使用介紹
本篇文章介紹了,jQuery 遍歷-nextUntil()方法以及prevUntil()方法的使用。需要的朋友參考下2013-04-04
jquery 實現(xiàn)兩級導(dǎo)航菜單附效果圖
兩級導(dǎo)航菜單在網(wǎng)頁中非常實用,實現(xiàn)的方法也有很多,本文為大家介紹下使用jquery是如何實現(xiàn)的2014-03-03
基于JQuery和DWR實現(xiàn)異步數(shù)據(jù)傳遞
這篇文章主要介紹了基于JQuery和DWR實現(xiàn)異步數(shù)據(jù)傳遞,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2020-10-10
jquery處理頁面彈出層查詢數(shù)據(jù)等待操作實例
這篇文章主要介紹了jquery處理頁面彈出層查詢數(shù)據(jù)等待操作,實例分析了jquery實現(xiàn)等待效果的技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-03-03

