日期:2014-05-18  浏览次数:20503 次

火狐不兼容JS

  <script language="javascript" type="text/javascript">
function s (){
document.getElementById("s").style.height=window.screen.height*0.65;
document.getElementById("a").style.height=window.screen.height*0.7;
}
  </script>

这段代码在ie中可以执行,在火狐和谷歌中却不行。

------解决方案--------------------
你写的不是W3C支持的,仅仅是IE支持
不用jQuery你就判断浏览器
看看document.getElementById("s").style.height后面有没有px
分类处理
------解决方案--------------------
探讨
在ie6中还有个问题,就是滑动鼠标滚轮的时候页面的滚动条越来越小可以无限的向下滑。