为什么function dragImage(e){
var e=(window.navigator.userAgent.indexOf("MSIE") >= 1)?window.event:e;
}
这个表达式 IE下成功得到了widow.event 在FF下却死也得不到e;为什么啊,这样真的没问题的啊。为什么就是不行了var e =e||event;这样的话 也是IE没问题 FF还是得不到,
alert(e)都是IE得到了object FF是unfind....
求解了
var e=(window.navigator.userAgent.indexOf("MSIE") >= 1)?window.event:e;
}
这个表达式 IE下成功得到了widow.event 在FF下却死也得不到e;为什么啊,这样真的没问题的啊。为什么就是不行了var e =e||event;这样的话 也是IE没问题 FF还是得不到,
alert(e)都是IE得到了object FF是unfind....
求解了
如果dragImage(e)里传参数,就IE FF都不行了
这里的event是必须的
<html>
<body>
<div id="templates" style="width:300px;height:400px;background-color:red"/>
</body>
</html>
<script>
document.getElementById("templates").onmousedown=dragImage;
function dragImage(e){
var evt=e||window.event;
alert(evt);
}
</script>