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', 'several/down.gif', 23], right:['rightarrowclass', 'several/right.gif']} 11 12var jqueryslidemenu={ 13 14animateduration: {over: 200, 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.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append( 27 '<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1]) 28 +'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0]) 29 + '" style="border:0;" />' 30 ) 31 $curobj.hover( 32 function(e){ 33 var $targetul=$(this).children("ul:eq(0)") 34 this._offsets={left:$(this).offset().left, top:$(this).offset().top} 35 var menuleft=this.istopheader? 0 : this._dimensions.w 36 menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width()-140)? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft 37 if ($targetul.queue().length<=1) //if 1 or less queued animations 38 $targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over) 39 }, 40 function(e){ 41 var $targetul=$(this).children("ul:eq(0)") 42 $targetul.slideUp(jqueryslidemenu.animateduration.out) 43 } 44 ) //end hover 45 $curobj.click(function(){ 46 $(this).children("ul:eq(0)").hide() 47 }) 48 }) //end $headers.each() 49 $mainmenu.find("ul").css({display:'none', visibility:'visible'}) 50 }) //end document.ready 51} 52} 53 54//build menu with ID="myslidemenu" on page: 55jqueryslidemenu.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.