People,
Can someone please take a look at this scrolling graphic & tell me what’s wrong with the script?:
http://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 correctly…but when I uploaded the site, the script caused it to scroll beautifully, allright…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.
Now...there's 3 parts to this script (as it was written.) The first is:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<script>
function moveBackground(x) {
var obj = document.getElementById('testy');
obj.style.backgroundPosition = ""+x+"px 0px";
setTimeout("moveBackground("+(x-1)+")",25);
}
</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...where the script writer referred to the layer ID as 'testy'...
...the 2nd is:
~~~~~~~~~~~~~~~~~~~~~~~~
<body onload="moveBackground(0);">
~~~~~~~~~~~~~~~~~~~~~~~~
...this component appears on the very next line after the script's closing tag (</script>)
...the third component is the layer itself, which contains the graphic (I added some layer coding myself, so as to get absolute positioning...so the graphic scrolled at the height & location on the page where I wanted it to):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div id="testy" style="background:url(SoundWave3.jpg) repeat-x; position:absolute; left:0px; top:285px; height:58px; width:800px;"> </div>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
those are the 3 components. The only thing I changed in the layer was to add the absolute positioning.
Can somebody help me out, here?...I’m not a programmer…but this page is almost there…almost working.
Thanks very much,
mark4man