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

如何禁止鼠标滚轮事件
我开始的加载页面时,添加了鼠标滚轮的监听事件,但是在触发某一事件A时,我想禁止鼠标滚轮事件,当这个事件A过去后,我又想继续监听鼠标的滚轮事件
window.onload=function()
{
  obj = document.getElementById("imgmap");//找到对象
  obj.onmousewheel = wheel;
}
function wheel(event)
{
//这里面是监听鼠标滚轮事件,就不写了
}
function ss()
{
//假设运行到这,我想禁止鼠标滚轮事件,应该怎么写,运行完ss(),跳到dd()
}
function dd()
{
//这里我又想能监听鼠标事件(即继续使用上面编写的鼠标监听事件wheel()),应该怎么写。
}
谢谢解答。

------解决方案--------------------
obj.onmousewheel ="oEvent.returnValue=false;return false;"