해상도에따라 다른페이지로 접속
<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에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 296 | JavaScript |
hwatta
|
20년 전 | 3371 | |
| 295 | JavaScript | 20년 전 | 3910 | ||
| 294 | 기타 | 20년 전 | 3659 | ||
| 293 | JavaScript |
kyodon
|
20년 전 | 3988 | |
| 292 | 기타 |
|
20년 전 | 4240 | |
| 291 | MySQL |
|
20년 전 | 4874 | |
| 290 | 기타 |
|
20년 전 | 4122 | |
| 289 | 기타 |
yesmoa
|
20년 전 | 7368 | |
| 288 | 기타 | 20년 전 | 5016 | ||
| 287 | MySQL |
홀로남은자
|
20년 전 | 6045 | |
| 286 | JavaScript | 20년 전 | 4383 | ||
| 285 | Flash | 20년 전 | 5761 | ||
| 284 | 기타 | 20년 전 | 5950 | ||
| 283 | 기타 | 20년 전 | 8483 | ||
| 282 | 기타 | 20년 전 | 4989 | ||
| 281 | 기타 | 20년 전 | 4119 | ||
| 280 | JavaScript |
크리스탈처럼
|
20년 전 | 6832 | |
| 279 | 기타 | 20년 전 | 3742 | ||
| 278 | 기타 |
|
20년 전 | 5888 | |
| 277 | 기타 | 20년 전 | 5625 | ||
| 276 | 기타 | 20년 전 | 3734 | ||
| 275 | 기타 | 20년 전 | 6241 | ||
| 274 | 기타 |
|
20년 전 | 3991 | |
| 273 | JavaScript | 20년 전 | 5582 | ||
| 272 | Linux | 20년 전 | 5213 | ||
| 271 | MySQL | 20년 전 | 5109 | ||
| 270 | 기타 | 20년 전 | 5799 | ||
| 269 | 기타 |
yesmoa
|
20년 전 | 7320 | |
| 268 | 기타 | 20년 전 | 7515 | ||
| 267 | JavaScript |
|
20년 전 | 3237 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기