I found this script on a javascript site that automatically scrolls the window up and down, is it possible to make tchange this to make a layer scroll up and down instead of the whle window??
Code:
<script type="text/javascript">
function page_size() {
var y, h;
if(window.innerHeight && window.scrollMaxY)
y = window.innerHeight + window.scrollMaxY;
else if(document.body.scrollHeight)
y = document.body.scrollHeight;
else y = document.body.offsetHeight;
if(window.innerHeight) h = window.innerHeight;
else if(document.documentElement && document.documentElement.clientHeight)
h = document.documentElement.clientHeight;
else if(document.body) h = document.body.clientHeight;
return ((y > h) ? y + 20 - h : false);
}
function init_scroll() {
init_scroll.height = page_size();
if(init_scroll.height) {
init_scroll.y = 0;
init_scroll.step = 20;
make_scroll();
}
}
function make_scroll() {
var y = (init_scroll.y += init_scroll.step);
if(y >= 0 && y <= init_scroll.height) {
window.scroll(0, y);
setTimeout(make_scroll, 600);
}
else {
init_scroll.step = -init_scroll.step;
setTimeout(make_scroll, 2000);
}
}
onload = init_scroll;
</script>