해상도에따라 다른페이지로 접속
<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에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 866 | 기타 | 18년 전 | 6247 | ||
| 865 | JavaScript | 18년 전 | 3302 | ||
| 864 | MySQL | 18년 전 | 7173 | ||
| 863 | MySQL | 18년 전 | 10654 | ||
| 862 | JavaScript | 18년 전 | 3099 | ||
| 861 | Flash |
DeepnBlue
|
18년 전 | 6805 | |
| 860 | Flash |
|
18년 전 | 5756 | |
| 859 | 기타 |
도날드주주
|
18년 전 | 3845 | |
| 858 | Flash | 18년 전 | 3735 | ||
| 857 | Flash | 18년 전 | 4367 | ||
| 856 | JavaScript | 18년 전 | 3682 | ||
| 855 | Flash | 18년 전 | 6745 | ||
| 854 | JavaScript | 18년 전 | 2538 | ||
| 853 | 기타 | 18년 전 | 7144 | ||
| 852 | PHP |
|
18년 전 | 4227 | |
| 851 | 기타 | 18년 전 | 7539 | ||
| 850 | Flash |
|
18년 전 | 8769 | |
| 849 | PHP | 18년 전 | 5144 | ||
| 848 | Flash | 18년 전 | 3119 | ||
| 847 | 기타 |
hwatta
|
18년 전 | 3369 | |
| 846 | Flash | 18년 전 | 5452 | ||
| 845 | 기타 | 18년 전 | 3163 | ||
| 844 | 기타 | 18년 전 | 2800 | ||
| 843 | Flash | 18년 전 | 3568 | ||
| 842 | MySQL | 18년 전 | 4154 | ||
| 841 | MySQL | 18년 전 | 5213 | ||
| 840 | PHP | 18년 전 | 5911 | ||
| 839 | JavaScript | 18년 전 | 3695 | ||
| 838 | MySQL | 18년 전 | 5092 | ||
| 837 | 기타 | 18년 전 | 3139 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기