Snippet Name: Variable Speed Horiz Scroll
Description: Nice horizontal scroller with variable scroll speed.
Comment: (none)
Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: February 28th, 2009
|
< s c r ipt type="text/javascript">
VAR i;
i = 1
FUNCTION scr() {
d = document.getElementById("a")
d.scrollLeft=i
diff = (d.scrollWidth - d.offsetWidth)
IF(d.scrollLeft == diff) {
d.scrollLeft = 0
i = 1
}
i = i + 1
window.setTimeout("scr()", 30)
}
</s c r ipt>
<div id="a" nowrap style="width:120px;height:20px;overflow:hidden">
<Table cellspacing='0' cellpadding='0' width=100%>
<tr>
<td nowrap>
<img src="a.gif" width=120px height=1>
Hello World, I am testing my SCROLL. Right to Left...enjoy!
<img src="a.gif" width=120px height=1>
</td>
</tr>
</Table>
</div>
<input type="button" value="go" onClick="scr()"> |