onmouseover시 onmouseout까지 따라다니는 레이어 띄우기..

· 15년 전 · 1631

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
  <style>
div.none { padding:15px 15px 15px 15px; width:370px; position:absolute; border-width:3; border-color:#cccccc; border-style:solid;font-size:9pt; background-color:#FFFFFF }
</style>
<script>
<!--
var preview="";
var gobj="";
function attachEvent_(obj, evt, fuc, useCapture) {
  if(!useCapture) useCapture=false;
  if(obj.addEventListener) { // W3C DOM 지원 브라우저
    return obj.addEventListener(evt,fuc,useCapture);
  } else if(obj.attachEvent) { // MSDOM 지원 브라우저
    return obj.attachEvent("on"+evt, fuc);
  } else { // NN4 나 IE5mac 등 비 호환 브라우저
    MyAttachEvent(obj, evt, fuc);
    obj['on'+evt]=function() { MyFireEvent(obj,evt) };
  }
}

function detachEvent_(obj, evt, fuc, useCapture) {
  if(!useCapture) useCapture=false;
  if(obj.removeEventListener) {
    return obj.removeEventListener(evt,fuc,useCapture);
  } else if(obj.detachEvent) {
    return obj.detachEvent("on"+evt, fuc);
  } else {
    MyDetachEvent(obj, evt, fuc);
    obj['on'+evt]=function() { MyFireEvent(obj,evt) };
  }
}

function MyAttachEvent(obj, evt, fuc) {
  if(!obj.myEvents) obj.myEvents= {};
  if(!obj.myEvents[evt]) obj.myEvents[evt]=[];
  var evts = obj.myEvents[evt];
  evts[evts.length]=fuc;
}

function MyFireEvent(obj, evt) {
  if(!obj.myEvents || !obj.myEvents[evt]) return;
  var evts = obj.myEvents[evt];
  for (var i=0;i<len;i++) {
    len=evts.length;
    evts[i]();
  }
}

function previewShow(e, obj, pv) {
  preview=pv;
  gobj=obj;
  attachEvent_(obj, "mousemove", previewMove, false);
  attachEvent_(obj, "mouseout", previewHide, false);
}

function previewMove(e) {
  var hb = document.getElementById(preview);
  if(hb.parentElement) hb.parentElement.style.display="";
  else hb.parentNode.style.display="";
  var evt = e ? e : window.event;
  var posx=0;
  var posy=0;

  if (evt.pageX || evt.pageY) { // pageX/Y 표준 검사
    posx = evt.pageX +8;
    posy = evt.pageY +16;
  } else if (evt.clientX || evt.clientY) { //clientX/Y 표준 검사 Opera
    posx = evt.clientX +10;
    posy = evt.clientY +20;
    if (window.event) { // IE 여부 검사
      posx += document.body.scrollLeft;
      posy += document.body.scrollTop;
     }
  }

  hb.style.left = posx + "px";
  hb.style.top = posy + "px";
}

function previewHide() {
  var hb = document.getElementById(preview);
  if(hb.parentElement) hb.parentElement.style.display="none";
  else hb.parentNode.style.display="none";

  detachEvent_(gobj,"mousemove", previewMove, false);
}
-->
</script>
</head>

<body>
<a href="#" onmouseover="previewShow(event,this,'tt_kin_1');">window.<b>attachEvent</b> 의 사용법</a>
<span style=display:none><div id=tt_kin_1 class=none> window.<b>attachEvent</b>( 'onload', ff);        ===========================    이렇게 썼을때는 잘되는데요  아래처럼 쓰고...</div></span>
<br><br>
<a href="#" onmouseover="previewShow(event,this,'tt_kin_2');">자바스크립트(select 스타일)어떻게 한거지 알려주세요.</a>
<span style=display:none><div id=tt_kin_2 class=none><img src="http://static.naver.com/kin/ending/icon_medal_q.gif">예전에 세이클럽에있었던 select 꾸미기 스타일 스크립트있었죠,   네이버 뉴스란에도 있었던 select  ...</div></span>
</body>

 </body>
</html>

[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
15년 전 조회 1,144
15년 전 조회 1,242
15년 전 조회 1,208
15년 전 조회 1,233
15년 전 조회 1,292
15년 전 조회 804
15년 전 조회 742
15년 전 조회 708
15년 전 조회 1,399
15년 전 조회 1,201
15년 전 조회 1,039
15년 전 조회 1,033
15년 전 조회 1,431
15년 전 조회 3,464
15년 전 조회 1,335
15년 전 조회 2,130
15년 전 조회 1,384
15년 전 조회 1,220
15년 전 조회 2,880
15년 전 조회 1,852
15년 전 조회 2,757
15년 전 조회 2,859
15년 전 조회 1,591
15년 전 조회 1,296
15년 전 조회 1,782
15년 전 조회 1,202
15년 전 조회 1,498
15년 전 조회 1,381
15년 전 조회 1,784
15년 전 조회 1,951
15년 전 조회 1,199
15년 전 조회 1,632
15년 전 조회 1,425
15년 전 조회 1,240
15년 전 조회 1,293
15년 전 조회 1,625
15년 전 조회 1,054
15년 전 조회 1,237
15년 전 조회 2,883
15년 전 조회 1,717
15년 전 조회 1,087
15년 전 조회 1,109
15년 전 조회 1,568
15년 전 조회 1,593
15년 전 조회 1,859
15년 전 조회 1,345
15년 전 조회 1,723
15년 전 조회 990
15년 전 조회 1,348
15년 전 조회 1,632
15년 전 조회 3,009
15년 전 조회 1,401
15년 전 조회 1,371
15년 전 조회 1,243
15년 전 조회 1,139
15년 전 조회 1,146
15년 전 조회 3,754
15년 전 조회 3,138
15년 전 조회 2,294
15년 전 조회 2,744
15년 전 조회 1,837
15년 전 조회 1,370
15년 전 조회 1,372
15년 전 조회 2,675
15년 전 조회 1,210
15년 전 조회 2,264
15년 전 조회 1,050
15년 전 조회 2,198
15년 전 조회 1,137
15년 전 조회 2,811
15년 전 조회 1,063
15년 전 조회 1,501
15년 전 조회 1,041
15년 전 조회 3,286
15년 전 조회 1,625
15년 전 조회 1,632
15년 전 조회 1,655
15년 전 조회 1,718
15년 전 조회 1,310
15년 전 조회 2,067
15년 전 조회 1,600
15년 전 조회 1,187
15년 전 조회 3,070
15년 전 조회 1,427
15년 전 조회 1,641
15년 전 조회 1,405
15년 전 조회 2,282
15년 전 조회 2,294
15년 전 조회 1,933
15년 전 조회 1,303
15년 전 조회 1,554
15년 전 조회 1,214
15년 전 조회 1,177
15년 전 조회 1,434
15년 전 조회 2,799
15년 전 조회 2,814
15년 전 조회 1,808
15년 전 조회 1,316
15년 전 조회 1,500
15년 전 조회 1,478