Lo ideal es que funcionara con:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
este es el codigo que no me funciona al utilizar cualquier DOCTYPE:
Código HTML:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript"> isIE=document.all; isNN=!document.all&&document.getElementById; isN4=document.layers; isHot=false; function ddInit(e){ topDog=isIE ? "BODY" : "HTML"; whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer"); hotDog=isIE ? event.srcElement : e.target; } function hideMe(){ if (isIE||isNN) whichDog.style.visibility="hidden"; else if (isN4) document.theLayer.visibility="hide"; } document.onmousedown=ddInit; document.onmouseup=Function("ddEnabled=false"); </script> <style type="text/css"> <!-- .style {color:#FF0000; font-size:12px; text-decoration:underline; font-weight:bold; margin-right:5px} --> </style> </head> <body> <p style="height:1000px"></p> <script> if (!document.layers) document.write('<div id="divStayTopLeft" style="position:absolute">') </script> <layer id="divStayTopLeft"> <div id="theLayer" style="position:absolute; width:400px; height:80px; top:100px; visibility:visible;" align="right"> <a href="#" onClick="hideMe();return false" class="style">X</a> <p align="center">Acá va una imagen</p> </div> </layer> <script type="text/javascript"> var verticalpos="fromtop" if (!document.layers) document.write('</div>') function JSFX_FloatTopDiv() { var startX = 405, startY = 200; var ns = (navigator.appName.indexOf("Netscape") != -1); var d = document; function ml(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; if(d.layers)el.style=el; el.sP=function(x,y){this.style.right=x;this.style.top=y;}; el.x = startX; if (verticalpos=="frombottom") el.y = startY; else{ el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight; el.y -= startY; } return el; } window.stayTopLeft=function() { if (verticalpos=="frombottom"){ var pY = ns ? pageYOffset : document.body.scrollTop; ftlObj.y += (pY + startY - ftlObj.y)/8; } else{ var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight; ftlObj.y += (pY - startY - ftlObj.y)/8; } ftlObj.sP(ftlObj.x, ftlObj.y); setTimeout("stayTopLeft()", 10); } ftlObj = ml("divStayTopLeft"); stayTopLeft(); } JSFX_FloatTopDiv(); </script> </body> </html>
espero me puedan ayudar.