`
mqqqvpppm
  • 浏览: 63770 次
  • 性别: Icon_minigender_1
  • 来自: Kun Ming
社区版块
存档分类
最新评论

JS implement scroll

阅读更多
html代码
 
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type"   content = "text/html; charset=iso-8859-1"   />   
  5. < title > Untitled Document </ title >   
  6. </ head >   
  7.   
  8. < body >   
  9. < img   onmouseover = "LeftOver()"   onmouseout = "LeftOut()"   onmousedown = "LeftDown()"    onmouseup = "LeftUp()"   src = "right.gif"   width = "13"   height = "13"   /> left         
  10. < img   onmouseover = "RightOver()"   onmouseout = "RightOut()"   onmousedown = "RightDown()"    onmouseup = "RightUp()"   src = "left.gif"   width = "13"   height = "13"   /> right  
  11. < DIV   id = "scrollBox"   style = "Z-INDEX: 100; OVERFLOW: hidden; WIDTH: 490px; POSITION: static; HEIGHT: 170px" >   
  12.     < TABLE   cellSpacing = 0   cellPadding = 0   width = "100%"   border = 0 > < TBODY >   
  13.                                   
  14.         < TR >           
  15.         < TD   id = "scrollObject" >                                         
  16.                                         < img   id = "pfxx"   src = "DSC08410.JPG"   width = "1280"   height = "960"   />                                         
  17.                 </ TD > <!--  logic for material 1 end -->                                    
  18.   
  19.         < TD   id = "scrollObjectMirror" > </ TD >          
  20.           
  21.         </ TR >   
  22.                                   
  23.                                   
  24.         </ TBODY > </ TABLE >   
  25. </ DIV >   
  26. < script   src = "scrollpic.js"   language = "javascript" > </ script >   
  27.   
  28.   
  29. </ body >   
  30. </ html >   


scroll.js 代码
 
  1. var  speed3=10 //??????????   
  2. scrollObjectMirror.innerHTML=scrollObject.innerHTML  
  3. function  MarqueeLeft(obj,obj1,obj2,step){  
  4.     if (obj2.offsetWidth-obj.scrollLeft<=0) {  
  5.         obj.scrollLeft-=obj1.offsetWidth  
  6.     }  
  7.     else {  
  8.         obj.scrollLeft+=step;  
  9.     }  
  10. }  
  11.   
  12. function  MarqueeRight(obj,obj1,obj2,step){  
  13.     if (obj.scrollLeft<=0) {  
  14.         obj.scrollLeft +=obj1.offsetWidth  
  15.     }  
  16.     else {  
  17.         obj.scrollLeft-=step;  
  18.     }  
  19. }  
  20.   
  21.   
  22.   
  23. var  MyMar1;  
  24.   
  25.   
  26. function  LeftOut(){clearInterval(MyMar1)}  
  27. function  LeftOver(){clearInterval(MyMar1);MyMar1=setInterval( "MarqueeLeft(scrollBox, scrollObject, scrollObjectMirror, 1)" ,speed3)}  
  28. function  RightOut(){clearInterval(MyMar1)}  
  29. function  RightOver(){clearInterval(MyMar1);MyMar1=setInterval( "MarqueeRight(scrollBox, scrollObject, scrollObjectMirror, 1)" ,speed3)}  
  30. //onmouseout="LeftOut()" onmousedown="LeftDown()"  onmouseup="LeftUp()"   
  31. function  LeftUp(){clearInterval(MyMar1);MyMar1=setInterval( "MarqueeLeft(scrollBox, scrollObject, scrollObjectMirror, 1)" ,speed3)}  
  32. function  LeftDown(){clearInterval(MyMar1);MyMar1=setInterval( "MarqueeLeft(scrollBox, scrollObject, scrollObjectMirror, 5)" ,speed3)}  
  33. function  RightUp(){clearInterval(MyMar1);MyMar1=setInterval( "MarqueeRight(scrollBox, scrollObject, scrollObjectMirror, 1)" ,speed3)}  
  34. function  RightDown(){clearInterval(MyMar1);MyMar1=setInterval( "MarqueeRight(scrollBox, scrollObject, scrollObjectMirror, 5)" ,speed3)}  


分享到:
评论

相关推荐

    Implement.js:使用 this 引用实现多个函数构造函数并扩展已实现的对象

    实现.js 凉亭: $ bower install --save Implement.js它是什么? 实现.js 是一个最小的javascript 模块模式,带有构造函数链管理,填补了(已经饱和的)javascript“事物”标记的空白。 令人惊讶的是,这种模式和...

    Java中extend与implement区别.doc

    Java 中 extend 与 implement 的区别 Java 语言中,extend 和 implement 是两个基本概念,它们之间的区别是非常重要的。extend 用于继承类,而 implement 用于实现接口。在 Java 中,不支持多重继承,但是可以使用...

    jcifs_java_implement_cifs

    jcifs_java_implement_cifs jcifs_java_implement_cifs jcifs_java_implement_cifs jcifs_java_implement_cifs jcifs_java_implement_cifs jcifs_java_implement_cifs

    js-leetcode题解之28-implement-strStr().js

    js js_leetcode题解之28-implement-strStr().js

    C Interface and Implement

    While most C programmers use APIs and the libraries that implement them in almost every application they write, relatively few programmers create and disseminate new, widely applicable APIs....

    eclipse implementor 插件

    Eclipse Implementor插件是专为Eclipse IDE设计的一款实用工具,它主要目的是为了帮助开发者更高效地实现接口或抽象类的方法。在Java编程中,当我们需要为一个接口或抽象类提供具体实现时,手动编写这些方法可能会...

    6.4.1 Packet Tracer - Implement Etherchannel

    6.4.1 Packet Tracer - Implement Etherchannel Cisco Packet Tracer 思科模拟器 正确答案文件 可直接上交正确答案文件 本答案版权归mewhaku所有,严禁再次转载!!! Copyright @mewhaku 2022 All Rights ...

    7.4.1 Packet Tracer - Implement DHCPv4

    7.4.1 Packet Tracer - Implement DHCPv4 Cisco Packet Tracer 思科模拟器 正确答案文件 由于程序问题无法保存激活DHCP端口配置 另加满分步骤截图 可直接上交正确答案文件 本答案版权归mewhaku所有,严禁再次...

    1.6.1 Packet Tracer - Implement a Small Network

    1.6.1 Packet Tracer - Implement a Small Network Cisco Packet Tracer 思科模拟器 正确答案文件 可直接上交正确答案文件 本答案版权归mewhaku所有,严禁再次转载!!! Copyright @mewhaku 2022 All Rights ...

    3.6.1 Packet Tracer - Implement VLANs and Trunking

    3.6.1 Packet Tracer - Implement VLANs and Trunking Cisco Packet Tracer 思科模拟器 正确答案文件 可直接上交正确答案文件 本答案版权归mewhaku所有,严禁再次转载!!! Copyright @mewhaku 2022 All Rights ...

    C++ file implement 英文习题

    C++ 针对 文件 操作 英文习题 Read the content of a file, and output to the screen. Every time after output 10 lines, ask users if they want to stop the program.

    odoo 10 implement. pdf

    非完美pdf版本,但是可以看 非完美pdf版本,但是可以看

    Design and Implement BI

    BI Design and implementation, BI Design and implementation, BI Design and implementation, BI Design and implementation,

    Practical Convolutional Neural Networks Implement advanced d l models using Py

    By the end of this book, you should be ready to implement advanced, effective and efficient CNN models at your professional project or personal initiatives by working on complex image and video ...

    hadoop join implement

    ### Hadoop Join Implementation:关键技术与优化策略 #### 摘要 在大数据处理领域,Hadoop作为主流的大规模数据处理框架之一,其MapReduce模型在并行数据处理方面展现出巨大优势。然而,对于数据间的连接操作(即...

    Teradata Cookbook Over 85 recipes to implement efficient data warehousing epub

    Teradata Cookbook Over 85 recipes to implement efficient data warehousing solutions 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

    Implement.js

    Implement.js是一个库,尝试以运行时类型检查的形式将接口引入JavaScript。 只需使用Interface定义一个Interface然后在对象上调用implement即可检查它是否实现了给定的接口。 const Hello = { greeting : '...

    SELinux_System_Administration_Implement_mandatory_access_control

    SELinux_System_Administration_Implement_mandatory_access_control.epub

    Implement with Class and Collection a List Collection with a

    标题 "Implement with Class and Collection a List Collection with a" 暗示了我们需要讨论如何使用类(Class)和集合(Collection)来实现一个列表集合,并具备添加(add)和移除(remove)数据元素的功能。...

    R Data Mining Implement data mining techniques through practical use cases mobi

    R Data Mining Implement data mining techniques through practical use cases and real world datasets 英文mobi 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索...

Global site tag (gtag.js) - Google Analytics