您的位置:首页 > Web前端 > JQuery

html、jquery判断浏览器,导入不同的css文件

2012-05-18 17:09 155 查看
浏览器是IE6,加载ie6.css;浏览器是IE7及以上版本,加载ie7.css;浏览器非IE,加载notIEcss.css。

<link href="index2/style2.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]><link href="index2/ie6.css" rel="stylesheet" type="text/css" /><![endif]-->

<!--[if gte IE 7]><link href="index2/ie7.css" rel="stylesheet" type="text/css" /><![endif]-->

<link href="#" id="notIEcssId" rel="stylesheet" type="text/css"/>
<script type="text/javascipt" >

$(document).ready(function(){

//如果浏览器不是ie,加载notIEccss文件

if( ! $.browser.msie) {

$("#notIEcssId").attr("href","notIEcss.css");

});

</script>

参考资料:http://www.poluoluo.com/jzxy/201110/145284.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: