해상도에 따라 배경 바꾸기

by 조쉬 posted Mar 01, 2014
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
<SCRIPT LANGUAGE="JavaScript">
<!--
  var Size = "UnCommon" 
   if (navigator.appVersion.indexOf("4.") != -1 && 
      navigator.appName.indexOf("Explorer") != -1) {
     ScrnSize = screen.width + "x" + screen.height;
  }
   if (navigator.appVersion.indexOf("4.") != -1 && 
      navigator.appName.indexOf("Netscape") != -1) {
     ScrnSize = screen.width + "x" + (screen.height + 19);
  }
   switch(Size) { 
    case "640x480":   document.write('<body bgcolor="#FF0000" text="#000000">');
    case "800x600":   document.write('<body bgcolor="#00FF00" text="#000000">');
    case "1024x768":  document.write('<body bgcolor="#0000FF" text="#000000">');
    case "1152x864":  document.write('<body bgcolor="#FFFF00" text="#000000">');
    case "1280x1024": document.write('<body bgcolor="#AA0000" text="#000000">');
    case "1600x1200": document.write('<body bgcolor="#FF00FF" text="#000000">');
    case "1600x1280": document.write('<body bgcolor="#00AA00" text="#000000">');
    default:          document.write('<body bgcolor="#FFFFFF" text="#000000">'); // 위의 해상도 크기에 맞지 않을때. 
  }
   document.write('<b>Browser Type :</b> '+navigator.appName+'<BR>');                     // 브라우저 형태
  document.write('<b>Browser Version :</b> '+navigator.appVersion+'<BR>');               // 브라우저 버전
  document.write('<b>Screen Resolution :</b> '+screen.width+"x"+screen.height+'<Br>');   // 해상도 크기
//-->
</script> 

Articles

3 4 5 6 7 8 9 10 11 12