脚本说明: 第一步:把如下代码加入<head>区域中(你可以对链接及说明作相应修改) <script LANGUAGE="JavaScript">
<!-- Begin function redirectPage() { var url640x480 = "http://www.163.com/"; var url800x600 = "http://www.sohu.com/"; var url1024x768 = "http://www.yoursite.com/"; if ((screen.width == 640) && (screen.height == 480)) window.location.href= url640x480; else if ((screen.width == 800) && (screen.height == 600)) window.location.href= url800x600; else if ((screen.width == 1024) && (screen.height == 768)) window.location.href= url1024x768; else window.location.href= url640x480; } // End --> </script>
第二步:把如下代码加入<body>区域中 <form> <input type=button value="进入符合分辨率的页面" onClick="redirectPage()"> </form>
|