使用window.addEventListener 和 window.attachEvent 判断浏览器

    if( window.addEventListener ){

         // IE
         win.addEventListener( "resize", callMedia, false );
      }
      else if( window.attachEvent ){

                //非IE
                win.attachEvent( "onresize", callMedia );
         }

文章来自:http://www.cnblogs.com/qiuyueguangxuan/p/4607579.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3