国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jquery Banner輪播選項卡

2019-11-19 18:15:39
字體:
來源:轉載
供稿:網友

本文實例為大家分享了jquery Banner輪播選項卡的具體代碼,供大家參考,具體內容如下

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title><style>.wraper{width: 1200px;margin: 0 auto;position: relative;}.banner{width: 100%;position: relative;height: 460px;}.banner ul{position:absolute; left:0; top:0; width:10000px;}.ba_slider{ width:1920px; height:460px; position:absolute; overflow: hidden; left: 50%; margin-left: -960px; }.ba_center{position: absolute;height: 460px;left: 50%;top: 0;margin-left:-600px; }.ba_slider ul{ position:relative; width: 100000px; }.ba_slider ul li{ position: relative;float: left; }.ba_slider img{ width:1920px; height:460px; }.ba_prev,.ba_next{ width:60px; height:100px; background:rgba(0,0,0,0.5); color:#fff; text-decoration:none; font-size:50px; line-height:100px; text-align:center; position:absolute; top:50%; margin-top:-50px; z-index:99; }.ba_prev{ left:0; }.ba_next{ right:0; }.ba_slider ol{ position:absolute; left:50%; bottom:10px; overflow:hidden; margin-left:-220px; }.ba_slider ol li{ width:100px;height:6px; background:rgb(85,85,85); float:left; margin-right:10px; }.ba_slider ol li.on{ background:#fff; }</style></head><body><div class="banner"><div class="ba_slider"><div class="wraper ba_center"><a class="ba_prev" href="javascript:;"><</a>   <a class="ba_next" href="javascript:;">></a></div>  <ul>   <li>   <a href="javascript:;">     <img src="http://scimg.VeVB.COm/allimg/140708/11-140FQ53531Q9.jpg" alt="" />    </a>   </li>   <li>   <a href="javascript:;">     <img src="http://sc.VeVB.COm/uploads/allimg/140520/10-140520212515A9.jpg" alt="" />    </a>   </li>   <li>   <a href="javascript:;">    <img src="http://www.xxyo.com/pictures/xz/4.jpg" alt="" />    </a>   </li>   <li>   <a href="javascript:;">    <img src="http://img1.3lian.com/2015/w7/85/d/25.jpg" alt="" />    </a>   </li>  </ul>  <ol>   <li class="on"></li>   <li></li>   <li></li>   <li></li>  </ol></div> </div></body><script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script><script>cBanner();function cBanner(){var iNow=0; //初始化自定義值var w = $('.ba_slider ul img').width(); //獲取圖片寬度function bTimer(){//定時器clearInterval(b_timer);//先關后開var b_timer = setInterval(function(){ iNow++; if(iNow == $('.ba_slider ul li').length){ //判斷是否最后一張圖片iNow=0;}tab(); //當前分頁器高亮$('.ba_slider ul').eq(0).animate({ //ul運動距離left:-iNow*w},1000);},2000); //定時器時間$('.ba_slider').mouseover(function(){ //鼠標移入關閉定時器clearInterval(b_timer);});}bTimer(); //定時器函數調用$('.ba_slider').mouseout(function(){//鼠標移出調用定時器bTimer();});$('.ba_next').click(function (){//點擊切換下一個圖片iNow++; if(iNow==$('.ba_slider ul li').length){ //判斷iNow是否為最后一張圖片iNow=0;}$('.ba_slider ul').eq(0).animate({  //運動距離left:-iNow*w},1000);tab(); //當前分頁器高亮});$('.ba_prev').click(function (){  //點擊切換上一個iNow--;if(iNow==-1){ //判斷是否是第一張圖片iNow = $('.ba_slider ul li').length-1 ;}$('.ba_slider ul').eq(0).animate({ //運動距離left:-iNow*w},1000);tab(); //當前分頁器高亮});$('ol li').click(function (){//點擊分頁器選擇圖片iNow=$(this).index();//iNow賦值為當前分頁器索引值$('.ba_slider ul').eq(0).animate({left:-iNow*w},1000);tab();});function tab(){//分頁器高亮效果$('ol li').removeClass('on');$('ol li').eq(iNow).addClass('on');}};</script></html>

github地址:https://github.com/seven-it/jqBanner

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 绥宁县| 亳州市| 新建县| 香河县| 阿合奇县| 荥阳市| 湟中县| 广宁县| 镇赉县| 颍上县| 镇远县| 乌鲁木齐县| 敦化市| 阿瓦提县| 光山县| 大同市| 象山县| 营山县| 荔浦县| 永福县| 武宁县| 宣武区| 察雅县| 东乌珠穆沁旗| 高邮市| 岚皋县| 阳新县| 宜川县| 莱阳市| 三明市| 得荣县| 青海省| 商都县| 潮州市| 合江县| 通化县| 青阳县| 高青县| 长葛市| 汉中市| 铜川市|