| 
									
										
										
										
											2011-08-28 12:46:50 +08:00
										 |  |  | (function( $ ){ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  /* DROPDOWN PLUGIN DEFINITION | 
					
						
							|  |  |  |   * ========================== */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   function clearMenus() { | 
					
						
							|  |  |  |     $('a.menu').parent('li').removeClass('open') | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-29 07:47:38 +08:00
										 |  |  |   $(function () { | 
					
						
							|  |  |  |     $(window).bind("click", clearMenus) | 
					
						
							|  |  |  |   }) | 
					
						
							| 
									
										
										
										
											2011-08-28 12:46:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   $.fn.dropdown = function ( options ) { | 
					
						
							|  |  |  |     return this.each(function () { | 
					
						
							|  |  |  |       $(this).delegate('a.menu', 'click', function (e) { | 
					
						
							|  |  |  |         clearMenus() | 
					
						
							|  |  |  |         $(this).parent('li').toggleClass('open') | 
					
						
							|  |  |  |         return false | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | })( jQuery || ender ) |