日期:2014-05-16  浏览次数:20325 次

弱弱的问一个问题?希望大家给个答案!!!
下面的代码:
为何   disabled   能禁止掉事件,却不能禁止掉   style属性能。
<img   src= 'First.bmp '   disabled   style= 'cursor:hand; '   onclick= 'alert( "aa ") '>

------解决方案--------------------
能用鼻子吃饭吗?
------解决方案--------------------
能吃能吃!我就吃过一次!
------解决方案--------------------
<script type= "text/javascript ">
function $(id) {
return document.getElementById(id);
}
function disabled(o) {
//禁止函数....
var div = document.body.appendChild(document.createElement( "div "));
with (div.style) {
position = "absolute ";
backgroundColor = "#FFFFFF ";
width = o.offsetWidth;
height = o.offsetHeight;
left = o.offsetLeft;
top = o.offsetTop;
opacity = "0 ";
filter = "alpha(opacity:0) ";
}
}
window.onload = function () {
disabled($( "cszd_img "));
}
</script>
<img id= "cszd_img " src= 'First.bmp ' disabled style= 'cursor:hand; ' onclick= 'alert( "aa ") '>