首页 >

jQuery+css实现的切换图片功能代码【jquery】

web前端|js教程jQuery+css实现的切换图片功能代码【jquery】
jQuery,css,切换图片
web前端-js教程
37快推源码,vscode切换最近打开,ubuntu最好用,nginx去tomcat,sqlite3怎么查看数据,爬虫原理及应用场景图,php出现中文乱码,海南seo优化信息推荐,开源快速网站搭建平台,支持网页代码的电子书代码,移动商城模板下载不了lzw
运行效果截图如下:
广西源码,实现类似vscode的界面,莱特币 ubuntu,tomcat内存优化方法,app云爬虫,php类的序列化,好的seo系统加盟代理,简单项目管理网站源码,怎么复制网站模板lzw
具体代码如下:
手机下单点餐系统源码,ubuntu怎么传统启动,怎样将tomcat服务器,腾讯云爬虫工具,25岁学php还是java,兰帝seolzw
    demo       body {    margin:0; padding:0;   }   .container {    border:6px solid gray; background:black;    width:600px; height:400px; position:relative;    left:50%; margin-left:-300px; border-radius:6px;    -webkit-border-radius:6px; -moz-border-radius:6px;    overflow:hidden;   }   .text-center {    text-align:center;   }   h1 {     font-size:50px; color:gray; font-weight:bolder;   }   .imgUL {    width:100%; height:100%; margin:0px; padding:0px; list-style:none;   }   .imgUL li {    float:left; margin:0px; padding:0px; height:100%;     color:gray; font-weight:bolder; text-align:center;    font-size:100px; line-height:400px;   }   .pageUL {    position:relative; top:-40px; height:40px; list-style:none;    margin:0px; padding:0px; float:right;   }   .pageUL li {    float:left; display:block; width:36px;    height:36px; border:2px solid red;     margin-left:5px; border-radius:4px;    -webkit-border-radius:4px; text-align:center;    -moz-border-radius:4px; line-height:36px;    color:gray; font-weight:bolder; cursor:pointer;   }   .pageUL li:hover {    background:#5ACF00; color:black;   }   .pageUL li.active {    background:#5ACF00; color:black;   }       $(document).ready(function(){    var autoInterval = null,     imgUL = $(".imgUL"),     imgliList = imgUL.children("li"),     liListLength = imgliList.length,     pageUL = $('.pageUL'),     pageLiList = pageUL.children('li'),     pageLiListLength = pageLiList.length,    // initialize    activePageLi = $(pageLiList[0]);    activePageLi.addClass('active');    imgliList.width(600);    imgUL.width(liListLength * 600);    $(".pageUL li").mouseover(function(){     mouseoverAnimate(this);    }).mouseout(function(){     createInterval();    });    createInterval();    function mouseoverAnimate(_this){     clearInterval(autoInterval);     activePageLi.removeClass('active');     activePageLi = $(_this);     var pageNo = parseInt(activePageLi.html());     activePageLi.addClass('active');     imgUL.animate({      'marginLeft': -600 * (pageNo - 1)     }, 10);    }    function createInterval(){     autoInterval = setInterval(function(){      var pageNo = parseInt(activePageLi.html());      pageNo++;      if(pageNo > pageLiListLength) {       pageNo = 1;      }      activePageLi.removeClass('active');      activePageLi = $(pageLiList[pageNo - 1]);      activePageLi.addClass('active');      imgUL.animate({       'marginLeft': -600*(pageNo - 1)      }, 1100);     }, 1500);    }   });      

Demo

Page1 Page2 Page3 Page4 Page5 Page6 1 2 3 4 5 6
更多关于jQuery特效相关内容感兴趣的读者可查看本站专题:《jQuery常见经典特效汇总》及《jQuery动画与特效用法总结》


jQuery+css实现的切换图片功能代码【jquery】
  • JS鼠标滑过图片时切换图片实现思路【javascript】
  • JS鼠标滑过图片时切换图片实现思路【javascript】 | JS鼠标滑过图片时切换图片实现思路【javascript】 ...

    jQuery+css实现的切换图片功能代码【jquery】
  • js实现使用鼠标拖拽切换图片办法【javascript】
  • js实现使用鼠标拖拽切换图片办法【javascript】 | js实现使用鼠标拖拽切换图片办法【javascript】 ...

    jQuery+css实现的切换图片功能代码【jquery】
  • IE6下通过a标签点击切换图片的问题【javascript】
  • IE6下通过a标签点击切换图片的问题【javascript】 | IE6下通过a标签点击切换图片的问题【javascript】 ...