<HTML>
<HEAD>
<TITLE>Zoom Property Sample</TITLE>


<script>
// +, - 키를 입력하면 화면 확대, 축소를 한다.
 document.onkeypress = getKey;
 
 function getKey(keyStroke) {
  isNetscape=(document.layers);
  eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
  which = String.fromCharCode(eventChooser).toLowerCase();
  which2 = eventChooser;

  var el=event.srcElement;

  if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA"))
  {   
   if(which == "+" )
    zoomIn();
   else if(which == "-" )
    zoomOut();
  }
 }
 
function zoomIn() {
  newZoom= parseInt(oZoom.style.zoom)+10+'%'
      oZoom.style.zoom =newZoom;
  }
function zoomOut() {
  newZoom= parseInt(oZoom.style.zoom)-10+'%'
      oZoom.style.zoom =newZoom;
  }
function changeZoom() {
  newZoom= parseInt(oSlider.value)
  oZoom.style.zoom=newZoom+'%';
  }
 
function changeZoom2(oSel) {
  newZoom= oSel.options[oSel.selectedIndex].innerText
  oZoom.style.zoom=newZoom;
  }
function iframeresize(){
var objBody = document.body;
var objFrame = document.all["ifrm1"];

objFrame.style.height = objBody.offsetHeight;
objFrame.style.width = objBody.offsetWidth;
}
</script>
</script>
</HEAD>
<BODY onload="oZoom.style.zoom='100%';iframeresize();" >
 
<!-- The zoomable area -->
<div class="zoomcontainer"  align="center">
<div id="oZoom" class="cZoom" style="zoom:100%" align="center">
<iframe src="http://www.duraboys.net" name=ifrm1 width=500 height=500></iframe>
</div>
</div>
<!-- Displayed code -->
<a href="#" onclick="zoomIn()">ZoomIN</a><a href="#" onclick="zoomOut()">ZoomOut</a>
</map>
</BODY>
</HTML>

'HTML & Script' 카테고리의 다른 글

자바스크립트로 만든 RSS리더  (0) 2007.05.02
이미지 사이즈 조절방법  (0) 2007.05.02
새로고침(F5) 전체창(F11) 못하게 막기  (2) 2007.05.02
문자열 길이  (0) 2007.05.02
아이디저장  (1) 2007.05.01

+ Recent posts