해상도에따라 다른페이지로 접속 > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

해상도에따라 다른페이지로 접속 정보

기타 해상도에따라 다른페이지로 접속

본문

<html>
<HEAD>
<TITLE> </TITLE>
<SCRIPT LANGUAGE="JavaScript">

function redirectPage() {
var url640x480 = "1.html";
var url800x600 = "2.html";
var url1024x768 = "3.html";
var url1280x1024 = "4.html";
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= url1280x1024;
}
// End -->
</script>
</HEAD>
<body onLoad="redirectPage()">
</body>
</html>


사용자 해상도가 640*480이면 1.html
800*600이면 2.html
1024*768이면 3.html
1280*1024이거나 이 외 해상도는 4.html 로 접속하게 됩니다.
여러가지로 응용이 되겠죠?

익스플로러&불여우에서 잘 됩니다.<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
추천
0
  • 복사

댓글 2개

© SIRSOFT
현재 페이지 제일 처음으로