By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Cutehtml Javascript works on IE & Opera but not Mozilla 3.0.1

P: 2
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="JavaScript">



<!--


//Specify the slider's width (in pixels)
var sliderwidth=700;
//Specify the slider's height (in pixels, pertains only to NS)
var sliderheight=145;
//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=slidespeed;
//copy contents of leftrightslide into one variable
for (i=0;i<leftrightslide.length;i++)
finalslide=finalslide+leftrightslide[i]+"&nbsp;&nbsp;";


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_slider0 2.document.width;
scrollslide();
}

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

//-->
</script>


<ilayer width=&{sliderwidth}; height=&{sliderheight}; name="ns_slider01" visibility=hide>
<layer name="ns_slider02" onMouseover="slidespeed=0;" onMouseout="slidespeed=copyspeed"></layer>
</ilayer>[/HTML]
Jul 28 '08 #1
Share this Question
Share on Google+
8 Replies


gits
Expert Mod 5K+
P: 5,343
the entire code uses outdated browser detection ... document.all for IE and document.layers otherwise ... the otherwise part is much too old ... so either use e newer script or start to code your own ones ... :)

kind regards
Jul 28 '08 #2

100+
P: 428
ilayer and layer are never going to be supported by any new browser.

You could use Netscape Navigator, which, along with IE4, are what CuteHTML thought was cute, in the '90s.
Jul 28 '08 #3

P: 2
yes. thank you guys. that explains. i need to update my HTML editor as well then.
Aug 7 '08 #4

P: 65
I'm working on a slide-show script myself at the moment, if you would like to use the completed product, just send me a private message. :)
Aug 8 '08 #5

acoder
Expert Mod 15k+
P: 16,027
Here's a nice simple one from the howto section.
Aug 8 '08 #6

P: 65
Ah, I'm working on a much more advanced one at the moment with things like play, backwards, pause, rewind, forward fast, skip forwards/backwards, and pick an image in the slide show in real time to jump to.
Aug 9 '08 #7

acoder
Expert Mod 15k+
P: 16,027
Maybe you could top that howto then ;)
Aug 9 '08 #8

P: 65
Haha! I'll give it a shot. :D
Aug 11 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.