BLOG main image
만만돌이's Blog
잡다한 공간?;;

'img'에 해당되는 글 1건

  1. 2006/09/18 이미지 마우스 따라 스크롤 하기

출처 : 야후 뉴스

<script language=javascript>
  function move_win() {
       var name = navigator.appName;
       var img_width = document.view_img.width;
       var img_height = document.view_img.height;
       var chk_width = screen.availWidth;
       if(chk_width <= img_width) {
           width = chk_width;
       }
       else {
           if(name == 'Microsoft Internet Explorer') {
               width = img_width + 12;
           } else {
               width = img_width + 8;
           }
       }

       var chk_height = screen.availHeight;
       if(chk_height <= img_height) {
           height = chk_height;
       }
       else {
           if(name == 'Microsoft Internet Explorer') {
               height = img_height + 30 + 20;
           } else {
               height = img_height + 45;
           }
       }

       self.resizeTo(width, height);
      
       if(document.all) { // for ie4+
           var moveY = (window.screen.height - document.body.clientHeight)/2 - 30;
           var moveX = (window.screen.width - document.body.clientWidth)/2 - 6;
           moveTo(moveX, moveY);
       }
       else if (document.layers || document.getElementById) {
           moveTo(screen.availLeft, screen.availTop);
       }
       self.focus();
  }

  function img_move() {
       if((document.view_img.width > (screen.availWidth - 9)) || (document.view_img.height > (screen.availHeight - 24))) {
           var x_scale = document.view_img.width/screen.availWidth;
           var y_scale = document.view_img.height/screen.availHeight;
           window.scroll(x_scale*(window.event.clientX - 50), y_scale*(window.event.clientY - 50));
       }
  }
</script>      
<style type="text/css">
html, body {   
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0;
  left: 0;
}
img {
  border: 0;
  display: block;
}
</style>
</head>
<body bgcolor="#D4D0C8" onLoad="move_win();"><img src="http://img.news.yahoo.co.kr/picture/e5/20060917/e520060917_27091987.jpg" name=view_img border=0 style="cursor:crosshair;margin:0" onMousemove="img_move();" onClick="javascript:window.close();" ></body>

샘플;;

1 

카테고리

분류 전체보기 (30)
xml (8)
여행-_-!! (0)
주저리 주저리 (16)
몽상 공간 -_-; (1)
잡다한 공간?; (5)
너를 (0)

달력

«   2008/12   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31