JS achieve seamless picture perfect solution rolling
Related Tags:
First understand what the targets of several attributes:
InnerHTML: Setting up or acquiring objects starting and ending at the html tag
ScrollHeight: access to highly targeted rolling.
ScrollLeft: Setting up or acquisition target in the left Border of the current window and that the content of the distance between the extreme left
ScrollTop: Setting up or acquisition target in the top window and the contents of the most visible in the distance between the top of
ScrollWidth: Acquiring objects rolling width
OffsetHeight: access to the layout of objects from the father or the designated coordinates offsetParent attribute the high degree of Father coordinates
OffsetLeft: access to the layout of objects or attributes specified by the offsetParent father coordinates the Position of the left
OffsetTop: access to the layout of objects or attributes specified by the offsetTop father coordinates the calculation of the top position
OffsetWidth: access to the layout of objects or attributes from Father coordinates offsetParent designated coordinates the width of the Father
Well, look at this upward rolling code:
<base Href="http://www.webjx.com">
<div Id=demo style=overflow:hidden;height:100;width:90;background:#214984;color:#ffffff> <div id=demo1>
<img Src="images/flash8.gif">
<img Src="images/link/flashempire.gif">
<img Src="images/linklogo/shlogo.gif">
<img Src="images/link/deskcity.gif">
<img Src="images/linklogo/5dmeng.gif">
<img Src="/Upload/2004_Pack/logo.gif">
<img Src="images/link/flashskylogo.gif">
<img Src="images/link/5dlogo88.gif">
<img Src="/Upload/2004_Pack/link.gif">
</ Div>
<div Id=demo2> </ div>
</ Div>
<script>
Var speed = 30
Demo2.innerHTML = demo1.innerHTML file: / / Cloning demo1 for demo2
Function Marquee () (
If (demo2.offsetTop-demo.scrollTop <= 0) file: / / demo1 when rolling to the junction with demo2
Demo.scrollTop-= demo1.offsetHeight file: / / Skip to the top of demo
Else (
Demo.scrollTop
)
)
Var MyMar = setInterval (Marquee, speed) file: / / Set the timer
Demo.onmouseover = function () (clearInterval (MyMar)) / / Mouse when he removed the timer to stop the rolling purpose
Demo.onmouseout = function () (MyMar = setInterval (Marquee, speed)) / / reset the mouse away when the timer
</ Script>
Scroll down:
<base Href="http://www.webjx.com">
<div Id=demo style=overflow:hidden;height:100;width:90;background:#214984;color:#ffffff>
<div Id=demo1>
<img Src="images/flash8.gif">
<img Src="images/link/flashempire.gif">
<img Src="images/linklogo/shlogo.gif">
<img Src="images/link/deskcity.gif">
<img Src="images/linklogo/5dmeng.gif">
<img Src="/Upload/2004_Pack/logo.gif">
<img Src="images/link/flashskylogo.gif">
<img Src="images/link/5dlogo88.gif">
<img Src="/Upload/2004_Pack/link.gif">
</ Div>
<div Id=demo2> </ div>
</ Div>
<script>
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>
Rolling left:
<base Href="http://www.webjx.com">
<div Id=demo style=overflow:hidden;height:33;width:500;background:#214984;color:#ffffff>
<table Align=left cellpadding=0 cellspace=0 border=0> <tr> <td id=demo1 valign=top>
<img Src="images/link/flashempire.gif"> <img src="images/linklogo/shlogo.gif">
<img Src="images/link/deskcity.gif"> <img src="images/linklogo/5dmeng.gif">
<img Src="/Upload/2004_Pack/logo.gif"> <img src="images/link/flashskylogo.gif">
<img Src="images/link/5dlogo88.gif"> <img src="/Upload/2004_Pack/link.gif">
<img Src="images/flash8.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>
Rolling right:
<base Href="http://www.webjx.com">
<div Id=demo style=overflow:hidden;height:33;width:500;background:#214984;color:#ffffff>
<table Align=left cellpadding=0 cellspace=0 border=0> <tr> <td id=demo1 valign=top>
<img Src="images/link/flashempire.gif"> <img src="images/linklogo/shlogo.gif">
<img Src="images/link/deskcity.gif"> <img src="images/linklogo/5dmeng.gif">
<img Src="/Upload/2004_Pack/logo.gif"> <img src="images/link/flashskylogo.gif">
<img Src="images/link/5dlogo88.gif"> <img src="/Upload/2004_Pack/link.gif">
<img Src="images/flash8.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>
- DIV of the increase with rolling
- Break website of the rolling
- Css with IE5.5 browser control of the rolling
- Asp.net in Css div rolling, as well as the use of ....
- JAVASCRIPT DIV used to replace non-spacing to achieve the effect of rolling news
- Control of rolling with the CSS style
- DIV
- Div rolling in the bottom of the
- Hovering not static effect of rolling with rolling achieve pure css
- Pages of text explain the rolling code
- Gerry in the unit or in a layer of the rolling
- Div ? ? ? ¨°
- Use CSS to be modified rolling
- New rolling Javascript
- For the production of rolling picture
- Simple - use of the existing web of rolling DIV element simulation.
- How to get rolling incident DIV
- Layer (table or div) about rolling
- About a rolling code
- Website of the CSS style rolling




