takeasy

your imagination is my power

網頁設計技巧:偵測解析度進入不同網頁

自動辨識瀏覽者解析度而進入不同的網頁

放於<head>與</head>之間:


<script type="text/javascript"> 
<!-- 
var swidth=1024var sheight=768;
if (screen.width<swidth||screen.height<sheight)
{ location.replace("800.htm"); } 
else { location.replace("1024.htm"); }
//--> 
</script> 
800.htm和1024.htm就是自動辨識解析度進入的網頁

0 留言:

發佈留言