Opened 11 years ago

Closed 10 years ago

Last modified 6 years ago

#453 closed task (wontfix)

Transform a function from jQuery into Prototype!

Reported by: micha Owned by: micha
Priority: major Milestone: Legacy Resolved
Component: FrameWork Keywords: javascript prototype jquery menu drop down
Cc:

Description

Hey guys,

who is good at javascript and can turn the following code that is based on the jQuery framework into Prototype? This would add a nice dropdown menu like on flickr to BeWelcome but we really can't afford to include another javascript framework in our application!

The code:

<script type="text/javascript">

$(document).ready(function(){

	$("#nicemenu img.arrow").click(function(){ 
								
		$("span.head_menu").removeClass('active');
		
		submenu = $(this).parent().parent().find("div.sub_menu");
		
		if(submenu.css('display')=="block"){
			$(this).parent().removeClass("active"); 	
			submenu.hide(); 		
			$(this).attr('src','arrow_hover.png');									
		}else{
			$(this).parent().addClass("active"); 	
			submenu.fadeIn(); 		
			$(this).attr('src','arrow_select.png');	
		}
		
		$("div.sub_menu:visible").not(submenu).hide();
		$("#nicemenu img.arrow").not(this).attr('src','arrow.png');
						
	})
	.mouseover(function(){ $(this).attr('src','arrow_hover.png'); })
	.mouseout(function(){ 
		if($(this).parent().parent().find("div.sub_menu").css('display')!="block"){
			$(this).attr('src','arrow.png');
		}else{
			$(this).attr('src','arrow_select.png');
		}
	});

	$("#nicemenu span.head_menu").mouseover(function(){ $(this).addClass('over')})
								 .mouseout(function(){ $(this).removeClass('over') });
	
	$("#nicemenu div.sub_menu").mouseover(function(){ $(this).fadeIn(); })
							   .blur(function(){ 
							   		$(this).hide();
									$("span.head_menu a").removeClass('active');
								});					   
							   
								   
});

</script>

Attachments (1)

FlickrMenu.zip (2.8 KB) - added by micha 11 years ago.
The flickr-like menu as a working example

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by micha

The flickr-like menu as a working example

comment:1 Changed 10 years ago by micha

  • Owner set to micha
  • Status changed from new to assigned

comment:2 Changed 10 years ago by micha

  • Resolution set to wontfix
  • Status changed from assigned to closed

I consider that as "will never do". Matthias nearly finished his menu-version.

comment:3 Changed 10 years ago by micha

  • follow_up changed from review code to none

comment:4 Changed 6 years ago by TimLoal

  • Component changed from unknown to FrameWork
  • Milestone changed from unassigned to Legacy Resolved
Note: See TracTickets for help on using tickets.