1/********************* 2//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/ 3//* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering 4//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/ 5*********************/ 6 7//Update: April 12th, 10: Fixed compat issue with jquery 1.4x 8 9//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs): 10var arrowimages={down:['downarrowclass', 'down.gif', 23], right:['rightarrowclass', 'right.gif']} 11 12var jqueryslidemenu={ 13 14animateduration: {over: 150, out: 100}, //duration of slide in/ out animation, in milliseconds 15 16buildmenu:function(menuid, arrowsvar){ 17 jQuery(document).ready(function($){ 18 var $mainmenu=$("#"+menuid+">ul") 19 var $headers=$mainmenu.find("ul").parent() 20 $headers.each(function(i){ 21 var $curobj=$(this) 22 var $subul=$(this).find('ul:eq(0)') 23 this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()} 24 this.istopheader=$curobj.parents("ul").length==1? true : false 25 $subul.css({top:this.istopheader? this._dimensions.h+"px" : 0}) 26 $curobj.hover( 27 function(e){ 28 var $targetul=$(this).children("ul:eq(0)") 29 this._offsets={left:$(this).offset().left, top:$(this).offset().top} 30 var menuleft=this.istopheader? 0 : this._dimensions.w 31 menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft 32 if ($targetul.queue().length<=1) //if 1 or less queued animations 33 $targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over) 34 }, 35 function(e){ 36 var $targetul=$(this).children("ul:eq(0)") 37 $targetul.slideUp(jqueryslidemenu.animateduration.out) 38 } 39 ) //end hover 40 $curobj.click(function(){ 41 $(this).children("ul:eq(0)").hide() 42 }) 43 }) //end $headers.each() 44 $mainmenu.find("ul").css({display:'none', visibility:'visible'}) 45 }) //end document.ready 46} 47} 48 49//build menu with ID="myslidemenu" on page: 50jqueryslidemenu.buildmenu("myslidemenu", arrowimages)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.