PageSourceSearch

https://benua.org/js/jqueryslidemenu.js

js benua.org collected 2026-10-04 23:41:39 UTC 2,430 bytes, 54 lines download raw bytes

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):
10
11var jqueryslidemenu={
12
13animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds
14
15buildmenu:function(menuid, arrowsvar){
16	jQuery(document).ready(function($){
17		var $mainmenu=$("#"+menuid+">ul")
18		var $headers=$mainmenu.find("ul").parent()
19		$headers.each(function(i){
20			var $curobj=$(this)
21			var $subul=$(this).find('ul:eq(0)')
22			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
23			this.istopheader=$curobj.parents("ul").length==1? true : false
24			$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
25			$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
26				'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
27				+'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
28				+ '" style="border:0;" />'
29			)
30			$curobj.hover(
31				function(e){
32					var $targetul=$(this).children("ul:eq(0)")
33					this._offsets={left:$(this).offset().left, top:$(this).offset().top}
34					var menuleft=this.istopheader? 0 : this._dimensions.w
35					menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
36					if ($targetul.queue().length<=1) //if 1 or less queued animations
37						$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over)
38				},
39				function(e){
40					var $targetul=$(this).children("ul:eq(0)")
41					$targetul.slideUp(jqueryslidemenu.animateduration.out)
42				}
43			) //end hover
44			$curobj.click(function(){
45				$(this).children("ul:eq(0)").hide()
46			})
47		}) //end $headers.each()
48		$mainmenu.find("ul").css({display:'none', visibility:'visible'})
49	}) //end document.ready
50}
51}
52
53//build menu with ID="myslidemenu" on page:
54jqueryslidemenu.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.