zoukankan      html  css  js  c++  java
  • 无缝滚动 Js

    js 无缝切换

    CSS
    .clearfix { clear: both; }
    .banner { width: 500px; height: 500px; overflow: hidden; margin: 0 auto; position: relative; background: url(../img/loading.gif) no-repeat center;}
    .banner ul { height: 500px;}
    .banner li {position: absolute; left: 500px; top: 0; width: 500px; height: 500px; list-style: none; z-index: 5;}
    .bannerspan { text-align: center; position: absolute; bottom: 10px; left: 0px; width: 500px; z-index: 11;}
    .bannerspan span { display: inline-block; width: 10px; height: 10px; border-radius: 5px; background: #0ff; margin: 0 3px; cursor: pointer;}
    .bannerspan span.on { background: #f0f;}
    JS:
    $(function(){ var li = $(".banner li"), _span = $(".bannerspan"), imgLength = li.length, time; // 生成圆点 for(var i = 0; i < imgLength; i++){ _span.append("<span></span>"); } // 初始 function init(){ li.eq(0).css("left",0).addClass("active"); _span.find("span").eq(0).addClass("on"); } init(); // 点击圆点事件 _span.find("span").click(function(){ clearInterval(time); run($(this).index()); }) // 获取当前展示的索引值 index function getActiveIndex(){ var j; li.each(function(e){ if($(this).hasClass("active")){ j = e; return; } }) return j; } run(1) // 公共函数 function run(dx){ li.eq(getActiveIndex()).stop().animate({left: -500, 'z-index': 5}, 500,function(){ $(this).css("left",500) }); li.eq(dx).stop().animate({'z-index': 10, left: 0}, 500, function(){ $(this).addClass("active").siblings().removeClass("active").css("left",500); }); _span.find("span").eq(dx).addClass("on").siblings().removeClass("on"); dx++; time = setTimeout(function(){ run(dx % imgLength) }, 2000) } })
    截图
  • 相关阅读:
    php后门隐藏技巧
    给你的PHP大马添加后门(黑吃黑)
    分析 PHP大马-php_mof SHELL
    过WAF菜刀制作
    eval与php一句话的关系
    php一句话转发脚本(可能过狗= =)
    wmic与mimikatz技巧
    LPK后门
    grunt常用插件的使用
    jquery实现后台系统左侧菜单的点击展开/收缩二级菜单效果
  • 原文地址:https://www.cnblogs.com/do-it/p/3482625.html
Copyright © 2011-2022 走看看