천

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

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

<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-30 조회 2,940
16-05-11 조회 3,456
16-03-21 조회 3,217
16-03-19 조회 3,156
16-03-17 조회 3,023
16-03-17 조회 3,051
16-03-14 조회 3,068
16-03-13 조회 2,994
16-03-09 조회 3,460
16-03-08 조회 3,069
16-03-08 조회 2,882
16-03-08 조회 2,906
16-03-08 조회 3,052
16-03-07 조회 2,837
16-03-07 조회 2,827
16-02-29 조회 3,236
16-02-25 조회 3,219
16-02-22 조회 3,022
16-02-12 조회 3,316
16-02-04 조회 3,146
16-02-04 조회 3,445
16-02-04 조회 3,078
16-02-03 조회 3,211
16-02-03 조회 3,028
16-02-02 조회 2,975
16-02-02 조회 2,864
16-02-01 조회 2,867
16-01-30 조회 2,698
16-01-30 조회 2,886
16-01-30 조회 3,026
16-01-30 조회 2,829
16-01-29 조회 2,691
16-01-28 조회 3,050
16-01-28 조회 2,905
16-01-27 조회 2,580
16-01-26 조회 2,562
16-01-26 조회 2,875
16-01-25 조회 2,618
16-01-22 조회 2,602
16-01-22 조회 2,680
16-01-21 조회 2,594
16-01-19 조회 2,509
16-01-19 조회 2,548
16-01-18 조회 2,533
16-01-17 조회 2,702
16-01-14 조회 2,621
16-01-13 조회 2,829
16-01-12 조회 2,920
16-01-12 조회 2,657
16-01-11 조회 2,713
15-12-30 조회 3,251
15-12-29 조회 2,623
15-12-28 조회 2,650
15-12-09 조회 2,718
15-12-08 조회 2,928
15-12-08 조회 2,676
15-12-08 조회 2,953
15-12-07 조회 2,748
15-12-07 조회 3,167
15-12-07 조회 2,775
15-12-06 조회 2,902
15-12-06 조회 2,615
15-12-06 조회 2,947
15-12-05 조회 2,780
15-12-05 조회 3,082
15-12-05 조회 2,806
15-12-04 조회 2,674
15-12-04 조회 2,782
15-12-04 조회 2,834
15-12-03 조회 2,787
15-12-03 조회 2,815
15-12-03 조회 2,864
15-12-02 조회 2,953
15-12-02 조회 2,873
15-12-02 조회 3,063
15-12-02 조회 3,203
15-12-01 조회 2,756
15-12-01 조회 2,553
15-12-01 조회 2,629
15-11-30 조회 2,816
15-11-30 조회 3,019
15-11-30 조회 2,880
15-11-29 조회 2,645
15-11-29 조회 2,902
15-11-29 조회 2,702
15-11-28 조회 2,642
15-11-28 조회 2,672
15-11-28 조회 2,705
15-11-27 조회 2,791
15-11-27 조회 2,646
15-11-27 조회 2,658
15-11-25 조회 2,752
15-11-25 조회 2,806
15-11-25 조회 2,597
15-11-23 조회 2,879
15-11-23 조회 3,046
15-11-23 조회 2,843
15-11-21 조회 2,745
15-11-21 조회 2,628
15-11-21 조회 2,572