Signin  Pricing  Examples  Support

Libraries > accordionmenu.js

accordionmenu.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://ianseo.net/templates/yoo_level/lib/js/addons/accordionmenu.js


Libraries on ianseo.net


mod_yoo_scroller.js

accordionmenu.js

base.js

dropdownmenu.js

fancymenu.js

mootools-release-1.12.js

yoo_tools.js



Explore More


html5.js

exceptions.js

js_dAlLv5DYHo-gFdfnMj1Orh1I9bRC06ArVqF4JTDO3Ck.js

js_I8yX6RYPZb7AtMcDUA3QKDZqVkvEn35ED11_1i7vVpc.js

accordionmenu.js
				
/* Copyright (C) 2007 - 2009 YOOtheme GmbH */

var YOOAccordionMenu = new Class({

	initialize: function(togglers, elements, options) {	
		this.setOptions({
			accordion: 'default'
		}, options);
		this.togs = togglers;
		this.elms = elements;
		
	    switch(this.options.accordion) {
			case 'slide':
				this.createSlide();
				break;
			
			default:
				this.createDefault();
   		}
	},
	
	createDefault: function() {
		var options = {};

		if (!$defined(this.options.display) && !$defined(this.options.show)) {
			options = { show: -1 };
		}
		$ES(this.togs).each(function(tog, i) {
			if (tog.hasClass('active')) options = { show: i };
		}.bind(this));	
		
		var accordionMenu = new Fx.Accordion(this.togs, this.elms, $extend(this.options, options));
	},

	createSlide: function() {
		$ES(this.togs).each(function(tog, i) {
			var span = tog.getElement('span');
			var ul = tog.getElement(this.elms);
			var fx = new Fx.Slide(ul, { transition: Fx.Transitions.linear, duration: 250 });

			if (!(tog.hasClass('active') || this.options.display == 'all' || this.options.display == i)) {
				fx.hide();
			}
			
			span.addEvent('click', function(){
				fx.toggle();
			});
		}.bind(this));	
	}
	
});

YOOAccordionMenu.implement(new Options);


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z