I use cutehtml as these are my starting days with Javascripts. The script generated by CuteHTML works in IE and Opera. It does not however work in Mozilla. its a slideshow of images. The problem with Mozilla is that the page loads and the slideshow never loads giving me a static blank area where the slideshow should have loaded.
I am pasting the script below.
[HTML]<script language="JavaS cript">
<!--
//Specify the slider's width (in pixels)
var sliderwidth=700 ;
//Specify the slider's height (in pixels, pertains only to NS)
var sliderheight=14 5;
//Specify the slider's scroll speed (larger is faster)
var slidespeed=7;
//Specify the slider's images
var leftrightslide= new Array();
var finalslide='';
leftrightslide[0]= '<img src="images/01.jpg" border=1>';
leftrightslide[1]='<img src="images/02.jpg" border=1>';
leftrightslide[2]='<img src="images/03.jpg" border=1>';
leftrightslide[3]='<img src="images/04.jpg" border=1>';
///////do NOT edit pass this line////////////////////////////////////
var copyspeed=slide speed;
//copy contents of leftrightslide into one variable
for (i=0;i<leftrigh tslide.length;i ++)
finalslide=fina lslide+leftrigh tslide[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.onmous eover=new Function("iesli der.scrollAmoun t=0");
//re-enable marquee when mouse is out
ieslider.onmous eout=new Function("if (document.ready State=='complet e') ieslider.scroll Amount=slidespe ed");
}
function regenerate(){
window.location .reload();
}
function regenerate2(){
if (document.layer s){
document.ns_sli der01.visibilit y="show";
setTimeout("win dow.onresize=re generate",450);
intializeleftri ghtslide();
}
if (document.all)
ieslider.scroll Amount=slidespe ed;
}
//NS specific function for initializing slider upon page load
function intializeleftri ghtslide(){
document.ns_sli der01.document. ns_slider02.doc ument.write('<n obr>'+finalslid e+'</nobr>');
document. ns_slider01.doc ument.ns_slider 02.document.clo se();
thelength=docum ent.ns_slider01 .document.ns_sl ider02.document .width;
scrollslide();
}
//NS specific function for sliding slideshow
function scrollslide(){
if (document.ns_sl ider01.document .ns_slider02.le ft>=thelength*(-1)){
document.ns_sli der01.document. ns_slider02.lef t-=slidespeed;
setTimeout("scr ollslide()",100 );
}
else{
document.ns_sli der01.document. ns_slider02.lef t=sliderwidth;
scrollslide();
}
}
window.onload=r egenerate2;
//-->
</script>
<ilayer width=&{sliderw idth}; height=&{slider height}; name="ns_slider 01" visibility=hide >
<layer name="ns_slider 02" onMouseover="sl idespeed=0;" onMouseout="sli despeed=copyspe ed"></layer>
</ilayer>[/HTML]
I am pasting the script below.
[HTML]<script language="JavaS cript">
<!--
//Specify the slider's width (in pixels)
var sliderwidth=700 ;
//Specify the slider's height (in pixels, pertains only to NS)
var sliderheight=14 5;
//Specify the slider's scroll speed (larger is faster)
var slidespeed=7;
//Specify the slider's images
var leftrightslide= new Array();
var finalslide='';
leftrightslide[0]= '<img src="images/01.jpg" border=1>';
leftrightslide[1]='<img src="images/02.jpg" border=1>';
leftrightslide[2]='<img src="images/03.jpg" border=1>';
leftrightslide[3]='<img src="images/04.jpg" border=1>';
///////do NOT edit pass this line////////////////////////////////////
var copyspeed=slide speed;
//copy contents of leftrightslide into one variable
for (i=0;i<leftrigh tslide.length;i ++)
finalslide=fina lslide+leftrigh tslide[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.onmous eover=new Function("iesli der.scrollAmoun t=0");
//re-enable marquee when mouse is out
ieslider.onmous eout=new Function("if (document.ready State=='complet e') ieslider.scroll Amount=slidespe ed");
}
function regenerate(){
window.location .reload();
}
function regenerate2(){
if (document.layer s){
document.ns_sli der01.visibilit y="show";
setTimeout("win dow.onresize=re generate",450);
intializeleftri ghtslide();
}
if (document.all)
ieslider.scroll Amount=slidespe ed;
}
//NS specific function for initializing slider upon page load
function intializeleftri ghtslide(){
document.ns_sli der01.document. ns_slider02.doc ument.write('<n obr>'+finalslid e+'</nobr>');
document. ns_slider01.doc ument.ns_slider 02.document.clo se();
thelength=docum ent.ns_slider01 .document.ns_sl ider02.document .width;
scrollslide();
}
//NS specific function for sliding slideshow
function scrollslide(){
if (document.ns_sl ider01.document .ns_slider02.le ft>=thelength*(-1)){
document.ns_sli der01.document. ns_slider02.lef t-=slidespeed;
setTimeout("scr ollslide()",100 );
}
else{
document.ns_sli der01.document. ns_slider02.lef t=sliderwidth;
scrollslide();
}
}
window.onload=r egenerate2;
//-->
</script>
<ilayer width=&{sliderw idth}; height=&{slider height}; name="ns_slider 01" visibility=hide >
<layer name="ns_slider 02" onMouseover="sl idespeed=0;" onMouseout="sli despeed=copyspe ed"></layer>
</ilayer>[/HTML]
Comment