<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="js/jquery-1.7.1.js" ></script>
<script>
if (!window.screenX) {
//IE6~8
alert(1);
var oStyle = document.createElement("link");
oStyle.rel = "stylesheet";
oStyle.type = "text/css";
if (screen.width > 1024) {
oStyle.href = "widthScreen.css";
} else {
oStyle.href = "normalScreen.css";
}
document.getElementsByTagName("head")[0].appendChild(oStyle);
}else{
//非 ie
alert(0);
}
$(window).resize(function(){
if($('body')[0].clientWidth<900){
location.href="https://www.baidu.com";
}
});
// 当界面的大小小于一定的值的时候进行的展示
</script>
</head>
<body>
<?php echo "hello World!"; ?>
</body>
</html>
撒花~~~