• JQ简单实现无缝滚动


    $(function(){
    $("ul li:lt(5)").clone().appendTo("ul");
    var $width = $("ul li:lt(5)").width() * 4;
    var currIndex = 0;
    $("#next").click(function(){
    if(currIndex == 2){
    currIndex = 0;
    $("ul").css("left",0);
    }
    currIndex++;
    $("ul").stop().animate({left:$width * currIndex * -1},500);
    });
    $("#prev").click(function(){
    if(currIndex == 0){
    currIndex = 2;
    $("ul").css("left",2 * $width * -1);
    }
    currIndex--;
    $("ul").stop().animate({left:$width * currIndex * -1},500);
    });
    $("ul>li").hover(function(){
    $(this).children().eq(1).stop().animate({top:0},400);
    },function(){
    $(this).children().eq(1).stop().animate({top:240},400);
    });
    });
  • 相关阅读:
    5月16日 AJAX
    5月13日 Jquery基础
    5月13日 PDO封装
    会话控制练习
    文件上传
    会话控制
    注册审核
    练习
    三级联动
    AJAX之XML
  • 原文地址:https://www.cnblogs.com/songxiaopei/p/5921017.html
Copyright © 2020-2023  润新知