zoukankan      html  css  js  c++  java
  • 项目pather代码

    //底部轮播功能
    //盒子scrollRight滚动 把滚动的li 插入ul第一个子元素当中 prepend
    var ulParentWidth = $('.patherBox').innerWidth();
    console.log(ulParentWidth);

    var lis = $('#runbox').children('li');
    var lislong = lis.length;
    var liWidth = lis.eq(0).outerWidth();
    var t3 = 400;
    var t4 = 2000;
    var timerPather;
    console.log(lislong*liWidth);
    //滚动
    //自动滚动
    if(lislong*liWidth > ulParentWidth){
    console.log(123);
    timerPather = setInterval(function(){
    $('#runbox').animate({"margin-left":"-"+liWidth},t3,function(){
    $(this).css("margin-left","0").children().eq(0).appendTo($(this));
    });
    },t4);
    }
    //暂停
    $('.patherBox').on({
    "mouseover":function(){
    clearInterval(timerPather);
    },
    "mouseout":function(){
    if(lislong*liWidth > ulParentWidth) {
    timerPather = setInterval(function () {
    $('#runbox').animate({"margin-left": '-' + liWidth}, t3,function(){
    $(this).css("margin-left", "0").children().eq(0).appendTo($(this));
    });
    }, t4);
    }
    }
    });
    //左右两边按钮
    //左边
    $('.glyphicon-menu-left').on({
    "mouseover":function(){
    clearInterval(timerPather);
    },
    "mouseout":function(){
    if(lislong*liWidth > ulParentWidth) {
    timerPather = setInterval(function () {
    $('#runbox').animate({"margin-left": '-' + liWidth}, t3,function(){
    $(this).css("margin-left", "0").children().eq(0).appendTo($(this));
    });
    }, t4);
    }
    },
    "click":function(){
    $('#runbox').animate({"margin-left": '-' + liWidth}, t3,function(){
    $(this).css("margin-left", "0").children().eq(0).appendTo($(this));
    });
    }
    });
    //右边
    $('.glyphicon-menu-right').on({
    "mouseover":function(){
    clearInterval(timerPather);
    },
    "mouseout":function(){
    if(lislong*liWidth > ulParentWidth) {
    timerPather = setInterval(function () {
    $('#runbox').animate({"margin-left": '-' + liWidth}, t3,function(){
    $(this).css("margin-left", "0").children().eq(0).appendTo($(this));
    });
    }, t4);
    }
    },
    "click":function(){
    $('#runbox').animate({"margin-left": liWidth}, t3,function(){
    $(this).css("margin-left", "0").children().last().insertBefore($(this).children().first());
    });
    }
    })
  • 相关阅读:
    10 Unit Testing and Automation Tools and Libraries Java Programmers Should Learn
    nginx unit java 试用
    Oracle Trace文件生成及查看
    记录数过亿条的表数据维护-数据删除
    对于上千万甚至上亿的数据,如何正确的删除?
    怎么快速删除大数据量表
    如何启动或关闭oracle的归档(ARCHIVELOG)模式
    oracle清理归档日志(缓存)
    HTTP和HTTPS协议,看一篇就够了
    HTTP与HTTPS对访问速度(性能)的影响
  • 原文地址:https://www.cnblogs.com/fdxxiaobai/p/6912664.html
Copyright © 2011-2022 走看看