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', '/hsl/images/down.gif', 0], right:['rightarrowclass', '/hsl/images/right.gif']} 11 12var jqueryslidemenu={ 13 14animateduration: {over: 100, out: 50}, //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 //BCA: offsetHeight not consistent across browsers so setting manually 26 //$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0}) 27 $curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append( 28 /*'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1]) 29 +'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0]) 30 + '" style="border:0;" />'*/ 31 '<span class="menuDDicon"> » </span>' 32 ) 33 $curobj.hover( 34 function(e){ 35 var $targetul=$(this).children("ul:eq(0)") 36 //this._offsets={left:$(this).offset().left, top:$(this).offset().top} 37 //var menuleft=this.istopheader? 0 : this._dimensions.w 38 //menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft 39 if ($targetul.queue().length<=1) //if 1 or less queued animations 40 //$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over) 41 $targetul.slideDown(jqueryslidemenu.animateduration.over) 42 }, 43 function(e){ 44 var $targetul=$(this).children("ul:eq(0)") 45 $targetul.slideUp(jqueryslidemenu.animateduration.out) 46 } 47 ) //end hover 48 $curobj.keydown(function(e){ //BCA Add for ADA purposes 49 if(e.keyCode == 13) { 50 var $targetul=$(this).children("ul:eq(0)"); 51 if ($targetul.queue().length<=1 && !$targetul.children().is(":visible")) { 52 if (this.istopheader) 53 $mainmenu.find("ul").css({display:'none', visibility:'visible'}) 54 $targetul.slideDown(jqueryslidemenu.animateduration.over); 55 e.preventDefault(); 56 return false; 57 } else { 58 $targetul.slideUp(jqueryslidemenu.animateduration.out); 59 } 60 } 61 }) //end keydown 62 $curobj.click(function(){ 63 $(this).children("ul:eq(0)").hide() 64 }) 65 }) //end $headers.each() 66 $mainmenu.find("ul").css({display:'none', visibility:'visible'}) 67 }) //end document.ready 68} 69}
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.