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

· 15년 전 · 1299

<!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년 전 조회 895
15년 전 조회 991
15년 전 조회 943
15년 전 조회 957
15년 전 조회 1,026
15년 전 조회 537
15년 전 조회 461
15년 전 조회 436
15년 전 조회 1,140
15년 전 조회 938
15년 전 조회 784
15년 전 조회 782
15년 전 조회 1,182
15년 전 조회 3,189
15년 전 조회 1,056
15년 전 조회 1,861
15년 전 조회 1,126
15년 전 조회 948
15년 전 조회 2,589
15년 전 조회 1,590
15년 전 조회 2,491
15년 전 조회 2,602
15년 전 조회 1,319
15년 전 조회 1,019
15년 전 조회 1,499
15년 전 조회 900
15년 전 조회 1,195
15년 전 조회 1,093
15년 전 조회 1,492
15년 전 조회 1,636
15년 전 조회 900
15년 전 조회 1,313
15년 전 조회 1,104
15년 전 조회 934
15년 전 조회 1,006
15년 전 조회 1,326
15년 전 조회 764
15년 전 조회 946
15년 전 조회 2,603
15년 전 조회 1,415
15년 전 조회 783
15년 전 조회 814
15년 전 조회 1,255
15년 전 조회 1,289
15년 전 조회 1,545
15년 전 조회 1,030
15년 전 조회 1,398
15년 전 조회 695
15년 전 조회 1,042
15년 전 조회 1,300
15년 전 조회 2,711
15년 전 조회 1,076
15년 전 조회 1,052
15년 전 조회 955
15년 전 조회 830
15년 전 조회 841
15년 전 조회 3,435
15년 전 조회 2,801
15년 전 조회 1,980
15년 전 조회 2,427
15년 전 조회 1,520
15년 전 조회 1,062
15년 전 조회 1,058
15년 전 조회 2,337
15년 전 조회 884
15년 전 조회 1,925
15년 전 조회 724
15년 전 조회 1,876
15년 전 조회 813
15년 전 조회 2,484
15년 전 조회 731
15년 전 조회 1,164
15년 전 조회 714
15년 전 조회 2,882
15년 전 조회 1,258
15년 전 조회 1,290
15년 전 조회 1,302
15년 전 조회 1,360
15년 전 조회 968
15년 전 조회 1,727
15년 전 조회 1,259
15년 전 조회 839
15년 전 조회 2,700
15년 전 조회 1,089
15년 전 조회 1,285
15년 전 조회 1,085
15년 전 조회 1,936
15년 전 조회 1,947
15년 전 조회 1,601
15년 전 조회 955
15년 전 조회 1,194
15년 전 조회 891
15년 전 조회 838
15년 전 조회 1,084
15년 전 조회 2,443
15년 전 조회 2,466
15년 전 조회 1,439
15년 전 조회 988
15년 전 조회 1,145
15년 전 조회 1,148
🐛 버그신고