해상도에따라 다른페이지로 접속
<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>
<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>
댓글 2개
20년 전
^^
醉生夢死™
19년 전
index에 추가하면 좋겠네요. 꼭 활용하게 될듯... 감사합니다.^^
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 326 | Flash |
|
20년 전 | 7808 | |
| 325 | 기타 |
|
20년 전 | 4663 | |
| 324 | 기타 |
hwatta
|
20년 전 | 3210 | |
| 323 | 기타 | 20년 전 | 9304 | ||
| 322 | MySQL | 20년 전 | 4153 | ||
| 321 | JavaScript | 20년 전 | 4821 | ||
| 320 | 기타 | 20년 전 | 6545 | ||
| 319 | 기타 | 20년 전 | 3872 | ||
| 318 | JavaScript | 20년 전 | 5252 | ||
| 317 | 기타 | 20년 전 | 4348 | ||
| 316 | Flash | 20년 전 | 5718 | ||
| 315 | JavaScript |
|
20년 전 | 7098 | |
| 314 | 기타 |
|
20년 전 | 7999 | |
| 313 | MySQL | 20년 전 | 8664 | ||
| 312 | JavaScript | 20년 전 | 3693 | ||
| 311 | 기타 |
|
20년 전 | 4675 | |
| 310 | 기타 |
|
20년 전 | 5263 | |
| 309 | JavaScript |
|
20년 전 | 4099 | |
| 308 | 기타 |
hwatta
|
20년 전 | 3788 | |
| 307 | JavaScript | 20년 전 | 6091 | ||
| 306 | 기타 | 20년 전 | 3494 | ||
| 305 | 기타 |
prosper
|
20년 전 | 3407 | |
| 304 | 기타 |
prosper
|
20년 전 | 3140 | |
| 303 | 기타 |
prosper
|
20년 전 | 3017 | |
| 302 | JavaScript | 20년 전 | 4994 | ||
| 301 | JavaScript | 20년 전 | 6276 | ||
| 300 | 기타 |
hwatta
|
20년 전 | 4074 | |
| 299 | 기타 |
|
20년 전 | 4207 | |
| 298 | Flash | 20년 전 | 7236 | ||
| 297 | 기타 |
hwatta
|
20년 전 | 4273 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기