0
添加事件時,FF4存在一些問題。看起來比我們的事件被捕獲和凍結。而在最後,我們對FF4使用窗口事件onResize的FF4問題
<html>
<head>
<script type="text/javascript">
function addEvent(elem, type, eventHandle) {
if (elem == null || elem == undefined) return;
if (elem.addEventListener) {
elem.addEventListener(type, eventHandle, false);
} else if (elem.attachEvent) {
elem.attachEvent("on" + type, eventHandle);
}
};
addEvent(window, "resize", function() { alert("hello there!"); });
</script>
</head>
<body>
test resize page
</body>
</html>
灰色的屏幕和它了正常的工作在IE7,鉻,FF3
Firefox的首選縮寫是「Fx」或「fx」 – Simeon 2011-05-27 12:57:16