Javascript not working in firefox or Safari

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
Reply

Join Date: Mar 2008
Posts: 2
Reputation: web4-every-1 is an unknown quantity at this point 
Solved Threads: 0
web4-every-1 web4-every-1 is offline Offline
Newbie Poster

Javascript not working in firefox or Safari

 
0
  #1
Mar 25th, 2008
Hello, can anybody help me in getting this code running also in firefox and safari. The goal is to display images scrolling from right to left on my screen ...
Here is the code I use :

<script language="JavaScript1.2">
//Specify the slider's width (in pixels)
var sliderwidth=840
//Specify the slider's height (in pixels, pertains only to NS)
var sliderheight=35
//Specify the slider's scroll speed (larger is faster)
var slidespeed=2

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''

leftrightslide[0]='<img src="sponsers/sponsors.gif" border=0>&nbsp;'
leftrightslide[1]='<img src="sponsers/sponsor1.gif" border=0>&nbsp;'
leftrightslide[2]='<img src="sponsers/sponsors.gif" border=0>&nbsp;'
//leftrightslide[3]='<a href="http://www.copycopy.be" target="_blank" title="Copy-Copy BVBA"><img src="sponsers/sponsor0.gif" border=0></a>&nbsp;''
//leftrightslide[4]='<a href="http://www.antwerpen.be" target="_blank" title="Antwerp"><img src="sponsers/tstad.gif" border=0></a>&nbsp;'

///////do NOT edit pass this line////////////////////////////////////

var copyspeed=slidespeed
//copy contents of leftrightslide into one variable
for (i=0;i<leftrightslide.length;i++)
finalslide=finalslide+leftrightslide[i]+" "


if (document.all){
//dynamically write out the marquee tag
document.write('<marquee id="ieslider" scrollAmount=0 style="width:'+sliderwidth+'">'+finalslide+'</marquee>')
//stop marquee when mouse is over it
ieslider.onmouseover=new Function("ieslider.scrollAmount=0")
//re-enable marquee when mouse is out
ieslider.onmouseout=new Function("if (document.readyState=='complete') ieslider.scrollAmount=slidespeed")}

function regenerate(){window.location.reload()}
function regenerate2(){if (document.layers){
document.ns_slider01.visibility="show"
setTimeout("window.onresize=regenerate",450)
intializeleftrightslide()}
if (document.all)
ieslider.scrollAmount=slidespeed}

//NS specific function for initializing slider upon page load
function intializeleftrightslide(){
document.ns_slider01.document.ns_slider02.document.write('<nobr>'+finalslide+'</nobr>')
document. ns_slider01.document.ns_slider02.document.close()
thelength=document.ns_slider01.document.ns_slider02.document.width
scrollslide()}

//NS specific function for sliding slideshow
function scrollslide(){if (document.ns_slider01.document.ns_slider02.left>=thelength*(-1)){
document.ns_slider01.document.ns_slider02.left-=slidespeed
setTimeout("scrollslide()",100)}
else{document.ns_slider01.document.ns_slider02.left=sliderwidth
scrollslide()}}
window.onload=regenerate2

//-->
</script>

thank you for any reaction ...
best regards,
Luc
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC