猿问

这样写 火狐浏览器不支持?

var mousewheelevt=(/Firefox/i.test(navigator.userAgent))?"DOMMouseScroll": "mousewheel"//FF doesn't recognize mousewheel as of FF3.x


      if(document.attachEvent) //if IE (and Opera depending on user setting)

      {document.attachEvent("on"+mousewheelevt,this.menu)

      console.log(21121)

      }

      else if(document.addEventListener) //WC3 browsers

      {

          document.addEventListener(mousewheelevt, this.menu, false)

          console.log(21111121)

      }


墨色风雨
浏览 497回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答