Cutehtml Javascript works on IE & Opera but not Mozilla 3.0.1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pitstop10
    New Member
    • Jul 2008
    • 2

    Cutehtml Javascript works on IE & Opera but not Mozilla 3.0.1

    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]+"&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.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]
    Last edited by gits; Jul 28 '08, 05:49 PM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    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

    Comment

    • mrhoo
      Contributor
      • Jun 2006
      • 428

      #3
      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.

      Comment

      • pitstop10
        New Member
        • Jul 2008
        • 2

        #4
        yes. thank you guys. that explains. i need to update my HTML editor as well then.

        Comment

        • moltendorf
          New Member
          • Jul 2007
          • 65

          #5
          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. :)

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Here's a nice simple one from the howto section.

            Comment

            • moltendorf
              New Member
              • Jul 2007
              • 65

              #7
              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.

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Maybe you could top that howto then ;)

                Comment

                • moltendorf
                  New Member
                  • Jul 2007
                  • 65

                  #9
                  Haha! I'll give it a shot. :D

                  Comment

                  Working...