∥″可乐〃∥

让我展望未来,网络是我不变的终结者!

« 可用性和用户体验的关系改变网页背景图片 »

自动按分辨率进入不同的页面

第一步:把如下代码加入<head>区域中(你可以对链接及说明作相应修改)
<script LANGUAGE="JavaScript">

<!-- Begin
function redirectPage() {
var url640x480 = "http://www.163.com/";
var url800x600 = "http://www.sohu.com/";
var url1024x768 = "http://free.2259.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>

Comments.

◎ welcome to participate in the discussion

日历

Comments.

Previous.

ADMIN. | EMAIL. | ABOUT.

Powered By Z-Blog 1.8 Spirit Build 80722Copyright © 2006-2011 可乐Blog Kele520.Com All Rights Reserved.[皖ICP备 06001314号]