Click to See Complete Forum and Search --> : scroll trouble
kikkioro
05-10-2003, 08:59 PM
ive been trying to start a new scroll window lately and ive been using this code: http://javascript.internet.com/scrolls/multiple-message-scroller.html but whenever i try to change the link urls the first link shows up but all the others come up as "undefined" and they keep on repeating as "undefined".
example:
//messages: affiliates
var singletext=new Array()
singletext[0]='<div align="center"><a href="http://.com" target="_blank"><img border="0" src="pic.jpg"></a></div>'
singletext[1]='<div align="center"><a href="http://.com" target="_blank"><img border="0" src="pic2.gif"></a></div>'
singletext[2]='<div align="center"><a href="http://.com" target="_blank"><img border="0" src="pic3.gif"></a></div>'
singletext[3]='<div align="center"><a href="http://.com" target="_blank"><img border="0" src="pic4.jpg"></a></div>'
none of the picture links show up except for the first one @"@
does ne1 know what im doing wrong? cuz i copy the code down correctly but whenever i change the links it messes up.
A1ien51
05-10-2003, 09:49 PM
I added your code to the script////and it ran
<html>
<!-- THREE STEPS TO INSTALL MULTIPLE MESSAGE SCROLLER:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
//slider's width
var swidth=350
//slider's height
var sheight=72
//slider's speed
var sspeed=2
//messages: change to your own; use as many as you'd like; set up Hyperlinks to URLs as you normally do: <a target=... href="... URL ...">..message..</a>
var singletext=new Array()
singletext[0]='<div align="center"><a href="http://.com" target="_blank">Img 1<img border="0" src="pic.jpg"></a></div>';
singletext[1]='<div align="center"><a href="http://.com" target="_blank">Img 2<img border="0" src="pic2.gif"></a></div>';
singletext[2]='<div align="center"><a href="http://.com" target="_blank">Img 3<img border="0" src="pic3.gif"></a></div>';
singletext[3]='<div align="center"><a href="http://.com" target="_blank">Img 4<img border="0" src="pic4.jpg"></a></div>';
if (singletext.length>1)
i=1
else
i=0
function start(){
if (document.all){
ieslider1.style.top=sheight
iemarquee(ieslider1)
}
else if (document.layers){
document.ns4slider.document.ns4slider1.top=sheight
document.ns4slider.document.ns4slider1.visibility='show'
ns4marquee(document.ns4slider.document.ns4slider1)
}
else if (document.getElementById&&!document.all){
document.getElementById('ns6slider1').style.top=sheight
ns6marquee(document.getElementById('ns6slider1'))
}
}
function iemarquee(whichdiv){
iediv=eval(whichdiv)
if (iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){
iediv.style.pixelTop=0
setTimeout("iemarquee(iediv)",100)
}
if (iediv.style.pixelTop>=sheight*-1){
iediv.style.pixelTop-=sspeed
setTimeout("iemarquee(iediv)",100)
}
else{
iediv.style.pixelTop=sheight
iediv.innerHTML=singletext[i]
if (i==singletext.length-1)
i=0
else
i++
}
}
function ns4marquee(whichlayer){
ns4layer=eval(whichlayer)
if (ns4layer.top>0&&ns4layer.top<=sspeed){
ns4layer.top=0
setTimeout("ns4marquee(ns4layer)",100)
}
if (ns4layer.top>=sheight*-1){
ns4layer.top-=sspeed
setTimeout("ns4marquee(ns4layer)",100)
}
else{
ns4layer.top=sheight
ns4layer.document.write(singletext[i])
ns4layer.document.close()
if (i==singletext.length-1)
i=0
else
i++
}
}
function ns6marquee(whichdiv){
ns6div=eval(whichdiv)
if (parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){
ns6div.style.top=0
setTimeout("ns6marquee(ns6div)",100)
}
if (parseInt(ns6div.style.top)>=sheight*-1){
ns6div.style.top=parseInt(ns6div.style.top)-sspeed
setTimeout("ns6marquee(ns6div)",100)
}
else{
ns6div.style.top=sheight
ns6div.innerHTML=singletext[i]
if (i==singletext.length-1)
i=0
else
i++
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="start()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<div align="center">
<span style="borderWidth:1; borderColor:red; width:350; height:72; background:navy">
<ilayer id="ns4slider" width="&{swidth};" height="&{sheight};">
<layer id="ns4slider1" height="&{sheight};" onmouseover="sspeed=0;" onmouseout="sspeed=2">
<script language="JavaScript">
if (document.layers)
document.write(singletext[0])
</script>
</layer></ilayer>
<script language="JavaScript">
if (document.all){
document.writeln('<div style="position:relative;overflow:hidden;width:'+swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight+' 0);border:1 solid red;" onmouseover="sspeed=0;" onmouseout="sspeed=2">')
document.writeln('<div id="ieslider1" style="position:relative;width:'+swidth+';">')
document.write(singletext[0])
document.writeln('</div></div>')
}
if(document.getElementById&&!document.all){
document.writeln('<div style="position:relative;overflow:hidden;width:'+swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight+' 0);border:1px solid red;" onmouseover="sspeed=0;" onmouseout="sspeed=2">')
document.writeln('<div id="ns6slider1" style="position:relative;width:'+swidth+';">')
document.write(singletext[0])
document.writeln('</div></div>')
}
</script></span>
</div>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 5.31 KB -->
</body>
</html>
A1ien51
05-10-2003, 09:51 PM
I just noticed, look at your images
2 SAY GIF !!!!!!!!!!!!!!
2 SAY JPEG!!!!!!!!!!!!!!
Is that right?>?
kikkioro
05-10-2003, 10:52 PM
its okai for them to say gif or jpeg, ive seen others use the code too and it worked for them
A1ien51
05-11-2003, 10:46 AM
What I am saying are all your pics gifs or jpegs? they are two totally different things
If you do not havw the right ending it will now show up
kikkioro
05-11-2003, 01:06 PM
well i have both gifs and jpgs but even if i change them all to gifs it still wont work.
THAT DOESNT HELP ME AT ALL, DARN YOU ALL, I NEED HELP :(
SEE MY LATEST POST RIGHT ABOVE THIS POST, PROBABLY...
i've noticed a few things:
in the original script at the end of the arrays they dont have ;
</div>';
in the original and the one here in the body there is sspeed; in one and sspeed without ;
There is nothing assigning "swidth" in the head script.
pERHAPS THIS COULD HELP, SOMEONE PLEASE FIX THIS? THX