•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 328,935 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,121 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 852 | Replies: 0 | Solved
•
•
Join Date: Mar 2008
Posts: 2
Reputation:
Rep Power: 0
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
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
•
•
•
•
age amd apple avatar beta blue gene browser browsers chips database development dos echo economy energy enterprise firefox hardware ibm ibm. news intel ibm internet internet explorer 7 it linux medicine memory microsoft mozilla news open source openoffice pc ps3 recession red hat russia safari security sun supercomputer supercomputing technology testing trends ubuntu web windows working x86
- 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



Threaded Mode