천

full-down메뉴 자바스크립트 입니다.

· 2015-12-19 (토) 00:50:51 · 2633

<script type="text/javascript">
<!--

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
 
//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all,
 
getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
 parentEl=parentEl.offsetParent;
}
return totaloffset;
},

showhide:function(obj, e, visible, hidden){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
 },

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
 this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
 edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
 var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
 this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
 edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
 edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden"
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e, "visible", "hidden")
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
 this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
 }
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
 this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'",this.disappeardelay)
 },

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
}
}
//-->
</script>

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-06-11 조회 3,071
16-02-15 조회 3,304
16-02-02 조회 2,969
16-01-25 조회 2,584
16-01-18 조회 2,690
16-01-08 조회 2,603
16-01-07 조회 2,613
16-01-05 조회 2,651
16-01-05 조회 2,947
16-01-05 조회 2,774
16-01-05 조회 2,804
16-01-04 조회 2,665
16-01-04 조회 2,671
16-01-04 조회 2,621
16-01-04 조회 2,532
15-12-30 조회 2,886
15-12-24 조회 2,699
15-12-24 조회 2,697
15-12-24 조회 2,723
15-12-24 조회 2,678
15-12-23 조회 2,664
15-12-16 조회 2,759
15-12-15 조회 2,821
15-12-11 조회 2,946
15-12-10 조회 2,807
15-11-09 조회 2,789
15-11-09 조회 3,012
15-10-06 조회 3,350
15-10-02 조회 3,125
15-05-29 조회 4,460
15-02-02 조회 4,439
15-01-18 조회 4,417
14-10-25 조회 8,378
14-10-25 조회 5,159
14-10-22 조회 7,161
14-10-22 조회 4,865
14-10-22 조회 4,818
14-10-18 조회 5,687
14-10-17 조회 6,065
14-10-17 조회 5,442
14-10-17 조회 8,977
14-10-17 조회 6,457
14-10-13 조회 4,384
14-10-13 조회 4,479
14-10-07 조회 6,160
14-09-24 조회 3,928
14-09-23 조회 3,994
14-09-22 조회 4,897
14-09-22 조회 6,128
14-09-22 조회 4,097
14-09-22 조회 3,770
14-09-21 조회 4,382
14-09-21 조회 3,866
14-09-20 조회 3,872
14-09-20 조회 3,776
14-09-20 조회 3,953
14-09-19 조회 3,876
14-09-19 조회 4,040
14-09-19 조회 3,927
14-09-19 조회 4,312
14-09-19 조회 3,949
14-09-19 조회 3,873
14-09-19 조회 4,160
14-09-19 조회 3,893
14-09-19 조회 3,943
14-09-19 조회 3,927
14-09-18 조회 4,004
14-09-18 조회 3,961
14-09-18 조회 4,230
14-09-18 조회 4,193
14-09-18 조회 4,208
14-09-18 조회 4,906
14-09-18 조회 5,464
14-09-18 조회 5,352
14-09-18 조회 4,149
14-09-18 조회 4,643
14-09-18 조회 4,267
14-08-30 조회 5,537
14-08-06 조회 6,019
14-08-06 조회 5,634
14-08-03 조회 5,274
14-06-12 조회 5,544
14-05-11 조회 3,725
14-05-11 조회 4,486
14-05-11 조회 4,594
14-05-09 조회 1.3만
14-05-01 조회 5,188
14-03-30 조회 4,396
14-03-23 조회 8,017
14-02-12 조회 3,900
13-10-29 조회 7,859
13-10-28 조회 8,686
13-09-29 조회 6,653
13-09-29 조회 4,281
13-07-23 조회 5,158
13-07-23 조회 1.2만
13-07-14 조회 4,687
13-07-14 조회 5,077
13-07-14 조회 6,040
13-07-14 조회 5,318