代码不兼容火狐和chrome,求高手修改!解决思路

代码不兼容火狐和chrome,求高手修改!
一段图片轮播的代码
<script type="text/javascript">
imgUrl1="images/01.jpg";
imgtext1="1"
imgLink1=escape("#");
imgUrl2="images/02.jpg";
imgtext2="1"
imgLink2=escape("#");
imgUrl3="images/03.jpg";
imgtext3="1"
imgLink3=escape("#");


 var focus_width=220
 var focus_height=152
 var text_height=0
 var swf_height = focus_height+text_height
 
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+""
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3+""
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+""
 
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="flash/focus1.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('</object>');
</script>

------解决方案--------------------
探讨

引用:

涉及到宽度和高度的地方加上px单位。。。
笨蛋一个,不会弄啊。照你说的改了。。代码就出错了

------解决方案--------------------
页面不兼容,都是前台页面设计人员最头痛的地方了。在排的时候最好是做一点就看一下效果。这样会方便调试一点。你这里的JS可能与CSS样式有冲突吧。JS里面的宽和高不需要加PX的。我估计是你的页面排版上面有问题,又或者页面没有消除浮动。
做个简单的例子吧:
<style>
.clear{clear:both;}
.home{width:500px; height:100px;}
.home_1{width:250px; height:100px; float:left;}
.home_2{width:250px; height:100px; float:right;}

</style>
<div class="home">
<div class="home_1"></div>
<div class="home_2"></div>
<div class="clear"></div> 这个时候这里就要用到浮动清除了。
</div>