Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with script

Status
Not open for further replies.

juuso79

Programmer
Nov 15, 2001
22
FI
I found this great scrolling script. It's allmost perfect but It doest stop scrolling down when the page ends. So If someone better java programmer could help me and modify this script so the scolling ends when the page ends I would be very gratefull.

<!-- Begin
function verScroll(dir, spd, loop) {
loop = true;
direction = &quot;up&quot;;
speed = 10;
scrolltimer = null;
if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval(&quot;document.getElementById('contentLayer').style&quot;);
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
}
}
}
direction = dir;
speed = parseInt(spd);
var y_pos = parseInt(page.top);
if (loop == true) {
if (direction == &quot;dn&quot;) {
page.top = (y_pos - (speed));
} else {
if (direction == &quot;up&quot; && y_pos < 10) {
page.top = (y_pos + (speed));
} else {
if (direction == &quot;top&quot;) {
page.top = 10;
}
}
}
scrolltimer = setTimeout(&quot;verScroll(direction,speed)&quot;, 1);
}
}
function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}
// End -->


<div id=&quot;scrollmenu&quot; style=&quot;position:absolute;width:200px;height:30px;z-index:1; left:400px; top: 40px&quot;>

<table><tr><td>
<a href=&quot;#&quot; onMouseOver=&quot;verScroll('dn','5','true')&quot; onMouseOut=&quot;stopScroll()&quot;>>></a>
</td></tr></table></div>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top