js与DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN不兼容 50
根据网上所说的,把document.body替换成:document.getElementById,还是不行,除了IE其他浏览器都正常。str1="<styletype=...
根据网上所说的,把document.body替换成:document.getElementById,还是不行,除了IE其他浏览器都正常。
str1="<style type=\"text/css\">.clo{float:right; width:15px; height:15px; margin-right:5px; display:inline;}</style><div style=\"float:left; width:159px; height:30px; padding-top:10px;cursor:pointer;background:#5BAE08 url(jq_header.jpg) no-repeat;text-align:right;color:#fff;\"><a onclick=\"javascript:closedb1();\"><img src=\"close.jpg\" class=\"clo\" width=\"15\" height=\"15\" border=\"0\" /></a></div><a href=\"#\" target=\"_blank\"><img src=\"dh.jpg\" border=\"0\" \/><\/a>";
showMsg1(str1);
document.write("</div>");
function showMsg1(str) {
var s="";
var _width="159";
var _height="620";
try{
if(document.compatMode && document.compatMode != 'BackCompat'){
s+=('<div style="float:right;z-index:9;right:1px;bottom:1px;height:'+_height+'px;width:'+_width+'px;overflow:hidden;position:fixed;'+(/MSIE/.test(navigator.appVersion)?'':'_position:absolute; _margin-top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);')+'" id="BottomMsg">');
}else {
s+=('<div style="float:right;z-index:9;right:1px;bottom:1px;height:'+_height+'px;width:'+_width+'px;overflow:hidden;position:fixed;*position:absolute;*top:expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)-this.style.pixelHeight);" id="BottomMsg" >');
}
s+=(str);
s+=('</div>');
//alert(s);
//document.getElementById('tmpMsgDiv').innerHTML = s;
document.write("<div id=tmpMsgDiv >"+s+"</div>");
}catch(err){}
}
function closedb1()
{
//setcookie('yx_click',1);
document.getElementById('tmpMsgDiv').style.display='none';
} 展开
str1="<style type=\"text/css\">.clo{float:right; width:15px; height:15px; margin-right:5px; display:inline;}</style><div style=\"float:left; width:159px; height:30px; padding-top:10px;cursor:pointer;background:#5BAE08 url(jq_header.jpg) no-repeat;text-align:right;color:#fff;\"><a onclick=\"javascript:closedb1();\"><img src=\"close.jpg\" class=\"clo\" width=\"15\" height=\"15\" border=\"0\" /></a></div><a href=\"#\" target=\"_blank\"><img src=\"dh.jpg\" border=\"0\" \/><\/a>";
showMsg1(str1);
document.write("</div>");
function showMsg1(str) {
var s="";
var _width="159";
var _height="620";
try{
if(document.compatMode && document.compatMode != 'BackCompat'){
s+=('<div style="float:right;z-index:9;right:1px;bottom:1px;height:'+_height+'px;width:'+_width+'px;overflow:hidden;position:fixed;'+(/MSIE/.test(navigator.appVersion)?'':'_position:absolute; _margin-top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);')+'" id="BottomMsg">');
}else {
s+=('<div style="float:right;z-index:9;right:1px;bottom:1px;height:'+_height+'px;width:'+_width+'px;overflow:hidden;position:fixed;*position:absolute;*top:expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)-this.style.pixelHeight);" id="BottomMsg" >');
}
s+=(str);
s+=('</div>');
//alert(s);
//document.getElementById('tmpMsgDiv').innerHTML = s;
document.write("<div id=tmpMsgDiv >"+s+"</div>");
}catch(err){}
}
function closedb1()
{
//setcookie('yx_click',1);
document.getElementById('tmpMsgDiv').style.display='none';
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询