...

View Full Version : XHTML DOCTYPE brakes script in FireFox.(maybe NS too).



TheNinthPlayer
06-08-2004, 04:12 AM
XHTML DOCTYPE brakes script in FireFox.(maybe NS too).

http://www.dynamicdrive.com/dynamicindex2/mikescroll.htm


<!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?

glenngv
06-08-2004, 04:28 AM
It might be caused by the use of cellpadding, cellspacing, ... attributes in the <table> tag as well as the use of the <font> tag.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum