zoukankan      html  css  js  c++  java
  • 循环滚动代码

    <div id=demo style="overflow:hidden; 128px; height:300px;">
    <div id=demo1>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    </div>
    <div id=demo2></div>
    </div>
    <script language="javascript">
    var speed=30
    demo2.innerHTML=demo1.innerHTML
    function Marquee(){
    if(demo2.offsetTop-demo.scrollTop<=0)
    demo.scrollTop-=demo1.offsetHeight
    else{
    demo.scrollTop++
    }
    }
    var MyMar=setInterval(Marquee,speed)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>

    向下:


    <div id=demo style="overflow:hidden; 128px; height:300px;">
    <div id=demo1>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>

    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    <img src="gfjs.gif"><br><img src="bxtt.gif"><br><img src="bzjd.gif"><br>
    </div>
    <div id=demo2></div>
    </div>
    <script language="javascript">
    var speed=30
    demo2.innerHTML=demo1.innerHTML
    demo.scrollTop=demo.scrollHeight
    function Marquee(){
    if(demo1.offsetTop-demo.scrollTop>=0)
    demo.scrollTop+=demo2.offsetHeight
    else{
    demo.scrollTop--
    }
    }
    var MyMar=setInterval(Marquee,speed)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>

    向左:

    <div id=demo style="overflow:hidden;height:100px;300px;"><table align=left

    cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><img src="gfjs.gif"><img

    src="bxtt.gif"><img src="bzjd.gif"><img src="gfjs.gif"><img src="bxtt.gif"><img

    src="bzjd.gif"></td><td id=demo2 valign=top></td></tr></table></div>
    <script>
    var speed=30
    demo2.innerHTML=demo1.innerHTML
    function Marquee(){
    if(demo2.offsetWidth-demo.scrollLeft<=0)
    demo.scrollLeft-=demo1.offsetWidth
    else{
    demo.scrollLeft++
    }
    }
    var MyMar=setInterval(Marquee,speed)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>

    向右:

    <div id=demo style="overflow:hidden;height:100px;300px;"><table align=left

    cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><img src="gfjs.gif"><img

    src="bxtt.gif"><img src="bzjd.gif"><img src="gfjs.gif"><img src="bxtt.gif"><img

    src="bzjd.gif"></td><td id=demo2 valign=top></td></tr></table></div>
    <script>
    var speed=30
    demo2.innerHTML=demo1.innerHTML
    demo.scrollLeft=demo.scrollWidth
    function Marquee(){
    if(demo.scrollLeft<=0)
    demo.scrollLeft+=demo2.offsetWidth
    else{
    demo.scrollLeft--
    }
    }
    var MyMar=setInterval(Marquee,speed)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>



    图片水中倒影特效
    <IMG height=189 id=reflect src="119.gif"
    width=237><BR>
    <SCRIPT language=JavaScript1.2>
    function f1(){
    setInterval("mdiv.filters.wave.phase+=10",100);
    }

    if (document.all){
    document.write('<img id=mdiv src="'+document.all.reflect.src+'" style="filter:wave(strength=3,freq=3,phase=0,lightstrength=30)  blur() flipv()">')
    window.onload=f1
    }
    </SCRIPT
  • 相关阅读:
    Compact Framework访问内嵌资源文件
    RBAC权限设计图 [转]
    c# 中判断用户是否按下CTRL键
    分享开发soket经验 我的基于socket的持久层 [转]
    没事教宝宝画画
    界面开发(一)[转]
    Winform中多国语言窗体的设计以及.NET中资源文件的使用[转]
    我眼中的理想系统
    C# WinForm开发系列 Socket/WCF/Rometing/Web Services[转]
    基于RBAC的权限设计模型[转]
  • 原文地址:https://www.cnblogs.com/tangself/p/1660675.html
Copyright © 2011-2022 走看看