Dux Vitae
2013. 3. 28. 11:10
2013. 3. 28. 11:10
<style> <!-- #postit{position:absolute;width:250;padding:5px;background-color:lightyellow;border:1px solid black;visibility:hidden;z-index:100;cursor:hand;} --> </style>
<body>
<div id="postit" style="left:150px;top:150px"> <div align="right"><b><a href="javascript:closeit()">[닫기]</a></b></div>
<b>포스트잇 스크립트</b><br> <p>페이지를 열면 작은 공지창 처럼 뜨는 포스트잇 스크립트 입니다<br> 마우스로 원하는 위치에 끌어 놓을 수 있답니다</p> <p>이 공지창은 브라우저를 열때마다 뜨게 할 수도 있고, 한번만 열리게 할 수도 있습니다</p> </div>
<script> var once_per_browser=0; //0은 브라우저 실행시마다 1은 딱 한번만
var ns4=document.layers var ie4=document.all var ns6=document.getElementById&&!document.all
if (ns4) crossobj=document.layers.postit; else if (ie4||ns6) crossobj=ns6? document.getElementById("postit") : document.all.postit;
function closeit(){ if (ie4||ns6) crossobj.style.visibility="hidden"; else if (ns4) crossobj.visibility="hide"; }
function get_cookie(Name) { var search = Name + "="; var returnvalue = "";
if (document.cookie.length > 0) { offset = document.cookie.indexOf(search);
if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end)); } }
return returnvalue; }
function showornot(){ if (get_cookie('postdisplay')==''){ showit(); document.cookie="postdisplay=yes"; } }
function showit(){ if (ie4||ns6) crossobj.style.visibility="visible"; else if (ns4) crossobj.visibility="show"; }
if (once_per_browser) showornot(); else showit();
</script>
<script language="JavaScript1.2">
function drag_drop(e){ if (ie4&&dragapproved){ crossobj.style.left=tempx+event.clientX-offsetx; crossobj.style.top=tempy+event.clientY-offsety; return false; } else if (ns6&&dragapproved){ crossobj.style.left=tempx+e.clientX-offsetx; crossobj.style.top=tempy+e.clientY-offsety; return false; } }
function initializedrag(e){ if (ie4&&event.srcElement.id=="postit"||ns6&&e.target.id=="postit"){ offsetx=ie4? event.clientX : e.clientX; offsety=ie4? event.clientY : e.clientY;
tempx=parseInt(crossobj.style.left); tempy=parseInt(crossobj.style.top);
dragapproved=true; document.onmousemove=drag_drop; } }
document.onmousedown=initializedrag; document.onmouseup=new Function("dragapproved=false");
</script> </body> </html> |