해

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

· 2010-09-18 (토) 03:12:58 · 2763

<!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에서 이동 됨]
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-07-13 조회 2,171
16-07-12 조회 2,353
16-07-12 조회 2,378
16-07-11 조회 2,193
16-06-05 조회 2,920
16-06-03 조회 3,035
16-05-26 조회 2,960
15-09-22 조회 4,990
15-06-10 조회 4,833
14-10-25 조회 6,359
14-10-22 조회 8,987
14-09-21 조회 5,793
14-09-16 조회 5,076
14-08-22 조회 1.1만
14-08-13 조회 5,905
14-08-12 조회 5,440
14-08-12 조회 6,301
14-08-11 조회 6,928
14-06-12 조회 6,209
14-06-11 조회 5,113
14-05-09 조회 5,426
14-05-09 조회 6,387
14-05-09 조회 6,418
14-05-08 조회 5,751
14-04-17 조회 4,750
14-04-16 조회 4,583
14-04-15 조회 4,587
14-04-15 조회 4,536
14-04-15 조회 4,307
14-04-14 조회 4,289
14-04-14 조회 4,260
14-04-14 조회 4,634
14-04-14 조회 4,781
14-04-14 조회 4,761
14-04-13 조회 4,667
14-04-12 조회 4,239
14-04-12 조회 4,380
14-04-12 조회 4,485
14-04-11 조회 5,009
14-04-10 조회 4,749
14-04-10 조회 4,780
14-04-09 조회 4,937
14-04-09 조회 5,307
14-04-08 조회 6,973
13-10-30 조회 7,654
13-07-11 조회 5,135
13-03-28 조회 1.1만
13-02-27 조회 6,790
13-02-14 조회 5,607
13-01-10 조회 4,522
12-12-31 조회 5,103
12-12-20 조회 6,121
12-12-12 조회 5,279
12-12-07 조회 4,503
12-11-28 조회 4,855
12-11-22 조회 5,296
12-11-12 조회 5,657
12-09-22 조회 4,513
12-09-18 조회 4,704