分享

让网页适应不同分辨率

 丑的不明显 2010-10-28
这种方法比较简单地,永和网络经常用到。大家可以根据自己地要求改。  
做3个页面,分别命名为“640480.htm”“800600.htm“1024768.htm”,3个页面分别为三种分辨率下浏览的页,然后index.htm的原代码如下:  
<html>  
<head>  
<script LANGUAGE="JavaScript">  
<!--Begin  
function redirectPage(){  
var url640x480="640480.htm";  
var url800x600="800600.htm";  
var url1024x768="1024768.htm";  
if((screen.width==640)&&(screen.height==480))  
window.lacation.href=url640x480;  
else if((screen.width==800)&&(screen.height==600))  
window.lacation.href=url800x600;  
else if((screen.width==1024)&&(screen.height==768))  
window.lacation.href=url1024x768;  
else window.lacation.href=url800x600;  
}  
//End--!>  
</script>  
</head>  
<body OnLoad="redirectPage();">  
</body>  
</html>  


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多