Forums
This topic is locked
Weird Image Scrolling...Please Help
Posted 12 Jun 2005 17:40:37
1
has voted
12 Jun 2005 17:40:37 Mark Forman posted:
<b>People,</b> Can someone please take a look at this scrolling graphic (implemented via java scripting) & tell me what’s wrong with the script...or if there's a proprietary component in Dreamweaver I should have used instead?:
mysite.verizon.net/vze3yjbu
I had wanted to add a graphic of a sound wave to my new site (created in Dreamweaver MX...which will be a resource site for digital musicians when complete); & to have it scroll across the page to resemble an audio track during playback in a computer-based digital audio workstation.
I created the graphic myself; & thought I had it configured properly with an appropriate java script to scroll at just the right speed…but when I uploaded the site, the script caused it to scroll just fine…but the cursor on the page undergoes a rapid-fire toggling between the cursor arrow & the hourglass.
One java programmer tells me it’s because the cursor is switching between normal & busy…due to the fact that the code is making a server call at the same rate the script causes it to scroll.
Another told me the problem can be fixed if the coding sets up the graphic to cache.
Here's the script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<script>
function moveBackground(x) {
var obj = document.getElementById('testy');
obj.style.backgroundPosition = ""+x+"px 0px";
setTimeout("moveBackground("+(x+1)+"",25);
}
</script>
<body onload="moveBackground(0);">
<div id="testy" style="background:url(graphic.jpg) repeat-x; height<img src=../images/dmxzone/forum/icon_smile_kisses.gif border=0 align=middle>Xpx; width<img src=../images/dmxzone/forum/icon_smile_kisses.gif border=0 align=middle>XXpx;"> </div>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The only thing I did (if you view my source code) was to add absolute positioning to the layer, so as to have it scroll across the page at the height & position I wanted.
Can somebody help me out, here?...I’m not a programmer…& the page is almost working...but should this have been done with Timelines or styles instead?
Thanks very much,
<b>mark4man</b>
Edited by - mark4man on 12 Jun 2005 17:48:01