IE常见问题兼容

1:让低版本IE兼容H5标签

  解决方案:引入一个插件:html5.js,(除了媒体播放器),

  项目写法:

       

1 <!--[if lt IE 10]>
2 
3          <script src="js/html5.js"></script>
4 <![endif]-->
View Code

   文件下载地址:https://github.com/awarriorer/compatibilityLowVersionForIE/

2:让低版本IE兼容H5 video视频播放器

   解决方案:引入一个插件,html5media.min.js同时需要把对应的flash(flowplayer.controls.swf[控制组件], flowplayer.swf[播放器])和js放在同一个目录。该插件的主要思想,把mp4通过flash插件播放出来。

   文件下载地址:https://github.com/awarriorer/compatibilityLowVersionForIE/

3:低版本IE实现Css3圆角

   解决方案:引入插件jquery.corner.js,本插件依托jquery。

   弊端:不能用彩色的底色,只能用白色,(如果打开控制台会发现,其实是js生成了好多个div,中间透明,白色的边。可能是我理解的还不到位,也希望知情者指正)

   Js下载地址:https://github.com/awarriorer/compatibilityLowVersionForIE/

   插件调用Api:http://www.zhangxinxu.com/study/201001/jquery-plugin-round-corner.html

4:低版本IE支持Css3选择器,

   解决方案:通过jquery选择器去弥补吧,略感鸡肋

 5:检测浏览器是否支持除css3属性

// 检测浏览器是否支持一个css3属性
function supportCss3(style) { 
    var prefix = ['webkit', 'Moz', 'ms', 'o'], 
        i, 
    humpString = [], 
    htmlStyle = document.documentElement.style, 
    
    _toHumb = function (string) { 
        return string.replace(/-(w)/g, function ($0, $1) { 
        return $1.toUpperCase(); 
        }); 
    }; 
     
    for (i in prefix) 
        humpString.push(_toHumb(prefix[i] + '-' + style)); 
     
        humpString.push(_toHumb(style)); 
     
    for (i in humpString) 
        if (humpString[i] in htmlStyle) return true; 
     
    return false; 
}

6:事件绑定方法

 1 //添加监听事件
 2 function addEvent( obj, type, fn ) { 
 3     if ( obj.attachEvent ) { 
 4         obj['e'+type+fn] = fn; 
 5         obj[type+fn] = function(){obj['e'+type+fn]( window.event );} 
 6         obj.attachEvent( 'on'+type, obj[type+fn] ); 
 7     } else{
 8         obj.addEventListener( type, fn, false ); 
 9     } 
10         
11 } 
12 //移除监听事件
13 function removeEvent( obj, type, fn ) { 
14     if ( obj.detachEvent ) { 
15         obj.detachEvent( 'on'+type, obj[type+fn] ); 
16         obj[type+fn] = null; 
17     } else {
18         obj.removeEventListener( type, fn, false ); 
19     }
20 }  
View Code

待发现,待解决,待更新……

原文地址:https://www.cnblogs.com/xxyy1122/p/4588176.html