今天,老大要我处理一个网站的兼容问题,一般兼容性问题是兼容其他浏览器,就IE不兼容,而这个有点特殊,只兼容IE,不兼容其他浏览器。初步观察以后,我发现是Javacript的问题。而不关div和css什么事情。
<SCRIPT language=JavaScript>
marqueesHeight=550;
stopscroll=false;
with(flash){
style.width=235;
style.height=marqueesHeight;
style.overflowX=”visible”;
style.overflowY=”hidden”;
noWrap=true;
onmouseover=new Function(“stopscroll=true”);
onmouseout=new Function(“stopscroll=false”);
}
document.write(‘<div id=”templayer1″ style=”position:absolute;z-index:1;visibility:hidden;top:6px;”></div>’);
preTop=0; currentTop=0;
function init1(){
templayer1.innerHTML=”";
while(templayer1.offsetHeight<marqueesHeight){
templayer1.innerHTML+=flash.innerHTML;
}
flash.innerHTML=templayer1.innerHTML+templayer1.innerHTML;
setInterval(“scrollUp1()”,20);//?
}
document.body.onload=init1;
function scrollUp1(){
if(stopscroll==true) return;
preTop=flash.scrollTop;
flash.scrollTop+=1;
if(preTop==flash.scrollTop){
flash.scrollTop=templayer1.offsetHeight-marqueesHeight;
flash.scrollTop+=1;
}
}
</SCRIPT>