Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow XHTML DOCTYPE brakes script in FireFox.(maybe NS too).

    XHTML DOCTYPE brakes script in FireFox.(maybe NS too).

    http://www.dynamicdrive.com/dynamici...mikescroll.htm
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    
    <div id="tempholder"></div>
    <script language="JavaScript" src="dhtmllib.js"></script>
    <script language="JavaScript" src="scroller.js"></script>
    <script language="JavaScript">
    
    /*
    Mike's DHTML scroller (By Mike Hall)
    Last updated July 21st, 02' by Dynamic Drive for NS6 functionality
    For this and 100's more DHTML scripts, visit http://www.dynamicdrive.com
    */
    
    //SET SCROLLER APPEARANCE AND MESSAGES
    var myScroller1 = new Scroller(0, 0, 480, 32, 1, 5); //(xpos, ypos, width, height, border, padding)
    myScroller1.setColors("#006600", "#ccffcc", "#009900"); //(fgcolor, bgcolor, bdcolor)
    myScroller1.setFont("Verdana,Arial,Helvetica", 2);
    myScroller1.addItem("<b>Click here for <a href='http://dynamicdrive.com'>Dynamic Drive</a>, the net\'s #1 DHTML site!</b>");
    myScroller1.addItem("<b>Visit <a href='http://www.brainjar.com'>Brain Jar</a>, Mike\'s great coding site!</b>");
    myScroller1.addItem("<b>Looking for free JavaScripts? Visit <a href='http://javascriptkit.com'>JavaScript Kit.</a>");
    myScroller1.addItem("<b>Discuss and get help on web coding, at <a href='http://www.codingforums.com'>CodingForums.com</a></b>");
    
    //SET SCROLLER PAUSE
    myScroller1.setPause(2500); //set pause beteen msgs, in milliseconds
    
    function runmikescroll() {
    
      var layer;
      var mikex, mikey;
    
      // Locate placeholder layer so we can use it to position the scrollers.
    
      layer = getLayer("placeholder");
      mikex = getPageLeft(layer);
      mikey = getPageTop(layer);
    
      // Create the first scroller and position it.
    
      myScroller1.create();
      myScroller1.hide();
      myScroller1.moveTo(mikex, mikey);
      myScroller1.setzIndex(100);
      myScroller1.show();
    }
    
    window.onload=runmikescroll
    </script>
    <div id="placeholder" style="position:relative; width:420px; height:32px;"> </div>
    If I take the DOCTYPE out the script works fine. Only the XHTML 1.1 DOCTYPE seems to effect it. Other HTML doctypes work fine. Does anyone know why the DOCTYPE makes FireFox mess it up?

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,946
    Thanks
    0
    Thanked 236 Times in 233 Posts
    It might be caused by the use of cellpadding, cellspacing, ... attributes in the <table> tag as well as the use of the <font> tag.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •