Adv Javascript DOCTYPE Problem with Firefox OnlyWorks in IE
pleas note DOCTYPE your site.
if you acept this doctype then ff error
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
Doctype Ok
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
Demo
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>king help</title>
</head>
<script language=”JavaScript”>
function fullscreen()
{
self.moveTo(0,0);
self.resizeTo(screen.width,screen.height);
}
</script>
<body>
<div id=”divAdLeft” style=”display: block; position: absolute; top: 0px; left: 0px;”>
baner left
</div>
<div id=”divAdRight” style=”display: block; position: absolute; top: 0px; right: 0px;”>
banner right</div>
<script language=”JavaScript”>
window.onresize=ShowAdDiv;
function FloatTopDiv()
{
var ns = (navigator.appName.indexOf(”Netscape”) != -1);
if(!ns)
{
startLX = ((document.body.clientWidth -1230)/2) + 110, startLY = 62;
startRX = ((document.body.clientWidth)/2) + 405 , startRY = 62;
}
else
{
startLX = ((document.body.clientWidth -1230)/2) + 110 , startLY = 0;
startRX = ((document.body.clientWidth -770)/2) + 790 , startRY = 0;
}
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startRX;
el.y = startRY;
return el;
}
function m2(id)
{
var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
e2.sP=function(x,y){this.style.left=x;this.style.top=y;};
e2.x = startLX;
e2.y = startLY;
return e2;
}
window.stayTopLeft=function()
{
if (document.documentElement && document.documentElement.scrollTop)
var pY = document.documentElement.scrollTop;
else if (document.body)
var pY = document.body.scrollTop;
if (document.body.scrollTop > 30){startLY = 3;startRY = 3;} else {startLY = 0;startRY = 0;};
ftlObj.y += (pY+startRY-ftlObj.y)/16;
ftlObj.sP(ftlObj.x, ftlObj.y);
ftlObj2.y += (pY+startLY-ftlObj2.y)/16;
ftlObj2.sP(ftlObj2.x, ftlObj2.y);
setTimeout(”stayTopLeft()”, 1);
}
ftlObj = ml(”divAdRight”);
//stayTopLeft();
ftlObj2 = m2(”divAdLeft”);
stayTopLeft();
}
function ShowAdDiv()
{
var objAdDivRight = document.getElementById(”divAdRight”);
var objAdDivLeft = document.getElementById(”divAdLeft”);
if (document.body.clientWidth < 980)
{
objAdDivRight.style.display = “none”;
objAdDivLeft.style.display = “none”;
}
else
{
objAdDivRight.style.display = “block”;
objAdDivLeft.style.display = “block”;
FloatTopDiv();
}
}
ShowAdDiv();
</script>
</body>
</html>
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



June 30th, 2009 at 4:54 am
fix version new multy doctype
http://www.kingf1.com/forum/viewtopic.php?f=11&t=394