欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

如何使用JQuery實(shí)現(xiàn)圖片輪播效果-創(chuàng)新互聯(lián)

這篇文章主要介紹了如何使用JQuery實(shí)現(xiàn)圖片輪播效果,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

平果ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18980820575(備注:SSL證書合作)期待與您的合作!

【效果如圖】

如何使用JQuery實(shí)現(xiàn)圖片輪播效果如何使用JQuery實(shí)現(xiàn)圖片輪播效果如何使用JQuery實(shí)現(xiàn)圖片輪播效果如何使用JQuery實(shí)現(xiàn)圖片輪播效果

【原理簡述】

這里大概說一下整個流程:

1,將除了第一張以外的圖片全部隱藏,

2,獲取第一張圖片的alt信息顯示在信息欄,并添加點(diǎn)擊事件

3,為4個按鈕添加點(diǎn)擊偵聽,點(diǎn)擊相應(yīng)的按鈕,用fadeOut,fadeIn方法顯示圖片

4,設(shè)置setInterval,定時執(zhí)行切換函數(shù)

【代碼說明】

filter(":visible") :獲取所有可見的元素

unbind():從匹配的元素中刪除綁定的事件

siblings:取得一個包含匹配的元素集合中每一個元素的所有唯一同輩元素的元素集合

【程序源碼】

首先引入JS文件:

  <script src="bootstrap/js/jquery-1.11.2.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <link href="bootstrap/css/bootstrap.min.css" rel="external nofollow" rel="stylesheet" type="text/css"/>

HTML部分:

<div id="banner"> 
   <ul>
    <li class="on"><a href="">1</a></li>
    <li><a href="">2</a></li>
    <li><a href="">3</a></li>
    <li><a href="">4</a></li>
    <li><a href="">5</a></li>
    <li><a href="">6</a></li>
   </ul>
   <div id="banner_list">
    <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_self"><img src="img/a1.jpg" width="280" height="160" /></a>
    <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_self"><img src="img/a2.jpg" width="280" height="160" /></a>
    <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_self"><img src="img/a3.jpg" width="280" height="160" /></a>
    <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_self"><img src="img/a4.jpg" width="280" height="160" /></a>
    <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_self"><img src="img/a5.jpg" width="280" height="160" /></a>
    <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_self"><img src="img/a6.jpg" width="280" height="160" /></a>
   </div>
  </div>

CSS部分:

<style type="text/css">
 #banner {position:relative; width:280px; height:160px; border:1px solid #666; overflow:hidden;}
 #banner ul { width:138px; height:18px;position:absolute;list-style-type:none;filter: Alpha(Opacity=80);opacity:0.8;z-index:1002;
    margin:0; padding:0; bottom:3px; right:5px; line-height: 18px; text-align: center;}
 #banner ul li { width: 18px; height: 18px; margin:0px 2px;float:left;display:block;color:#FFF;
           border:#e5eaff 1px solid;background:#6C6D6E;cursor:pointer} 
 #banner ul li.on { background:#900}
 #banner ul li a { color: white;}
 #banner ul li a:hover{text-decoration: none;}
 #banner_list a{position:absolute;} <!-- 讓六張圖片都可以重疊在一起-->
 #banner_list{position:absolute; right: 5px; bottom: 5px;}
 </style>

JS部分:

<script type="text/javascript">
 var t = n =0, count;
 $(document).ready(function(){ 
  count=$("#banner_list a").length;
  $("#banner_list a:not(:first-child)").hide();
  $("#banner_info").html($("#banner_list a:first-child").find("img").attr('alt'));
  $("#banner_info").click(function(){window.open($("#banner_list a:first-child").attr('href'), "_blank")});
  $("#banner li").click(function() {
   var i = $(this).text() -1;//獲取Li元素內(nèi)的值,即1,2,3,4
   n = i;
   if (i >= count) return;
   $("#banner_info").html($("#banner_list a").eq(i).find("img").attr('alt'));
   $("#banner_info").unbind().click(function(){window.open($("#banner_list a").eq(i).attr('href'), "_blank")})
   $("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
   document.getElementById("banner").style.background="";
   $(this).toggleClass("on");
   $(this).siblings().removeAttr("class");
  });
  t = setInterval("showAuto()", 4000);
  $("#banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);});
 })
 
 function showAuto()
 {
  n = n >=(count -1) ?0 : ++n;
  $("#banner li").eq(n).trigger('click');
 }
 </script>

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“如何使用JQuery實(shí)現(xiàn)圖片輪播效果”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián)成都網(wǎng)站設(shè)計公司,關(guān)注創(chuàng)新互聯(lián)成都網(wǎng)站設(shè)計公司行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

分享文章:如何使用JQuery實(shí)現(xiàn)圖片輪播效果-創(chuàng)新互聯(lián)
文章路徑:http://www.aaarwkj.com/article10/ccpdgo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、網(wǎng)站維護(hù)、虛擬主機(jī)、手機(jī)網(wǎng)站建設(shè)、定制開發(fā)、搜索引擎優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)
日韩人妻有码中文字幕| 九九精品在线观看视频| 亚洲国产中文一区二区久久| 高清偷自拍亚洲精品三区| 999热这里只有精品视频| 中文字幕精品久久久人妻| 人妻少妇一区二区三区四区| 午夜神马福利激情视频| 精品国产一区二区三区四不卡在线| 国产a情人一区二区国产| 国产精品成人av在线网站| 99久久成人精品国产片| 欧美日韩在线国产一区| 国产av剧情一区二区| 国产三级精品三级在线专区1| 免费毛片一区二区三区| 成人深夜免费观看视频| 国产精品黄色自拍合集| 人人妻人人澡人人爽人人dvd| 亚洲午夜激情免费试看| 欧美日韩国产综合下一页| 99精品国产一区二区青青性色 | 日本人妻内射一区二区| 偷窥偷拍视频一区二区| 一区二区人妻乳中文字幕| 青草草在线观看视频| 蜜臀在线观看免费视频| 夫妻性生活视频一级片| 日韩在线视频一区二区三| 欧洲一区二区在线激情| 亚洲成人av在线直播| 国产成人综合欧美日韩另类| 日韩高清中文字幕在线| 精品国产熟女成人av| 一本久久精品午夜福利| 绯色av一区二区三区蜜臀| 亚洲av成人一区二区三区 | 成人高清在线观看91| 久久人妻制服乱码中文字幕| 国产剧情av网址观看免费| 成人黄色18免费网站|