| | |
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 |
•
•
Join Date: Mar 2008
Posts: 2
Reputation:
Solved Threads: 0
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> '
leftrightslide[1]='<img src="sponsers/sponsor1.gif" border=0> '
leftrightslide[2]='<img src="sponsers/sponsors.gif" border=0> '
//leftrightslide[3]='<a href="http://www.copycopy.be" target="_blank" title="Copy-Copy BVBA"><img src="sponsers/sponsor0.gif" border=0></a> ''
//leftrightslide[4]='<a href="http://www.antwerpen.be" target="_blank" title="Antwerp"><img src="sponsers/tstad.gif" border=0></a> '
///////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
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> '
leftrightslide[1]='<img src="sponsers/sponsor1.gif" border=0> '
leftrightslide[2]='<img src="sponsers/sponsors.gif" border=0> '
//leftrightslide[3]='<a href="http://www.copycopy.be" target="_blank" title="Copy-Copy BVBA"><img src="sponsers/sponsor0.gif" border=0></a> ''
//leftrightslide[4]='<a href="http://www.antwerpen.be" target="_blank" title="Antwerp"><img src="sponsers/tstad.gif" border=0></a> '
///////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
![]() |
Similar Threads
- Safari crashes after clicking on Daniweb links. (OS X)
- Firefox Javacript problem (Web Browsers)
- Dynamic iFrame height, not working in ie without refresh. (JavaScript / DHTML / AJAX)
- javascript not working for firefox! (JavaScript / DHTML / AJAX)
- PHP developer (Post your Resume)
- Javascript not working under Mac! Why O why?! (JavaScript / DHTML / AJAX)
- Javascript not working on a mac! Why O why? (Java)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: radio button vs textbox ala Javascript
- Next Thread: Ajax 3 contained files
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box browser bug calendar captchaformproblem cart close codes column css cursor date debugger decimal dependent design disablefirebug dom download dropdown element embed engine enter error events ext file firefox focus form frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 iframe images index java javascript javascripthelp2020 jawascriptruntimeerror jquery jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 onmouseoutdivproblem onmouseover paypal pdf php player position post problem programming prototype redirect regex safari scale scriptlets scroll search security select software sql text textarea unicode w3c website window windowofwords windowsxp





