• 无缝滚动 js 一


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
    <html>
    <head>
    <style>
    body{height:10000px; background:#ccc;}
    #gg_left, #gg_right{
    position: fixed;
    }
    #gg_left{120px;height:240px;top:230px;left:0;}
    #gg_right{120px;height:240px;top:230px;right:0;}
    </style>
    <!--[if lte IE 6]>
    <style type="text/css">

    #gg_left, #gg_right{
    position: absolute;
    }
    </style>
    <![endif]-->

    </head>
    <body>

    <div id="gg_left"><embed src="C:UsersloveDesktop320.swf" width="120px;" height="240px;"></div>
    <div id="gg_right"><embed src="C:UsersloveDesktop320.swf" width="120px;" height="240px;"></div>

    <div id="tickerContainer" style="400px;margin:10px auto;">
    <div id="ticker">
    <ul id="demo">edk;cwscdweqweqwdqw</ul>
    <ul id="demo">234545qw565656dqw</ul>
    <ul id="demo">0fdkfFEP2edk;cwscdweqweqwdqw</ul>
    <ul id="demo">0--=-kokfedk;cwscdweqweqwdqw</ul>

    </div>
    </div>

    <script type="text/javascript" src="xxx/jquery.js"></script>(可到网上搜索,或直接用网上的路径,如google的)
    <script type="text/javascript">
    $(function() {

    //cache the ticker
    var ticker = $("#ticker");

    //wrap dt:dd pairs in divs
    ticker.children().filter("demo").each(function() {

    var dt = $(this),
    container = $("<div>");

    dt.next().appendTo(container);
    dt.prependTo(container);

    container.appendTo(ticker);
    });

    //hide the scrollbar
    ticker.css("overflow", "hidden");

    //animator function
    function animator(currentItem) {

    //work out new anim duration
    var distance = currentItem.height();
    duration = (distance + parseInt(currentItem.css("marginTop"))) / 0.025;

    //animate the first child of the ticker
    currentItem.animate({ marginTop: -distance }, duration, "linear", function() {

    //move current item to the bottom
    currentItem.appendTo(currentItem.parent()).css("marginTop", 0);

    //recurse
    animator(currentItem.parent().children(":first"));
    });
    };

    //start the ticker
    animator(ticker.children(":first"));

    //set mouseenter
    ticker.mouseenter(function() {

    //stop current animation
    ticker.children().stop();

    });

    //set mouseleave
    ticker.mouseleave(function() {

    //resume animation
    animator(ticker.children(":first"));

    });
    });
    </script>

    </body>
    </html>

  • 相关阅读:
    Java -- 最简单的认识重载
    maven打包spring boot项目及跳过test文件
    springboot 配置elasticsearch Java High Rest Client
    面向对象与面向过程的区别
    vue --- axios拦截器+form格式请求体
    kotlin --- 时间戳与字符串互相转换
    各种技术的路线图
    bpmn-js起步
    纵观 jBPM:从 jBPM3 到 jBPM5 以及 Activiti5
    几大工作流引擎对比
  • 原文地址:https://www.cnblogs.com/zhicheng/p/3183680.html
Copyright © 2020-2023  润新知