$(function(){
var windows_width=$(window).width()
alert(windows_width)
if ( $(window).width() > 1024)
{
alert("大屏幕");
$("head").append('<link href="big.css" rel="stylesheet" type="text/css">');
//document.write("<link href='big.css' rel='stylesheet' type='text/css'>");
// window.location.reload(); //刷新
}
else
{
alert("小屏幕");
$("head").append('<link href="small.css" rel="stylesheet" type="text/css">');
//document.write("<link href='small.css' rel='stylesheet' type='text/css'>");
// window.location.reload(); //刷新
}
})
转载于:https://my.oschina.net/u/583531/blog/300695