使用window.addEventListener 和 window.attachEvent 判断浏览器
if( window.addEventListener ){
// IE
win.addEventListener( "resize", callMedia, false );
}
else if( window.attachEvent ){
//非IE
win.attachEvent( "onresize", callMedia );
}