event.preventDefault()方法是用于取消事件的默认行为,但此方法并不被ie支持,在ie下需要用window.event.returnValue = false; 来实现。
复制代码 代码如下:
function stopDefault( e )
{
if ( e && e.preventDefault ){ e.preventDefault();
} else { window.event.returnValue = false;
} }
最后
以上就是多情白云最近收集整理的关于网页右键ie不支持event.preventDefault和event.returnVal的全部内容,更多相关网页右键ie不支持event内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复