欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery輪播圖插件使用方法詳解

 更新時間:2020年07月31日 10:56:19   作者:taff  
這篇文章主要為大家詳細介紹了jquery輪播圖插件的使用方法,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了jquery輪播圖插件使用案例,供大家參考,具體內容如下

代碼

<!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",//下標容器
 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圖片輪播

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

最新評論