腾讯的手机屏幕的适配代码

 

腾讯的适配代码 ,比较权威 ,果断盗用!

 

<script type="text/javascript"> 
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
    if(window.location.href.indexOf("?mobile")<0){
        try{
            if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
                window.location.href="http://shipei.qq.com/index.htm";
            }else if(/iPad/i.test(navigator.userAgent)){
            }else{
                window.location.href="http://shipei.qq.com/simple/s/index/"
            }
        }catch(e){}
    }
}
</script>

 

 

 

 

 

 

posted @ 2014-06-11 17:48  mjorcen  阅读(410)  评论(0编辑  收藏  举报