MediaWiki:Neowikimon.js

/*Test*/

(function($, undefined) {   var open = [];

var opts = { selector: '.dropdown2', toggle: 'dropdown2-toggle', open: 'dropdown2-open', nest: true };

$(document).on('click.dropdown2 touchstart.dropdown2', function(e)   {        // Close the last open dropdown2 if click is from outside the target dropdown2        if ( open.length && ( ! opts.nest || ! open[ open.length - 1 ].find( e.target ).length ) )        {            open.pop.removeClass( opts.open );        }

var $this = $(e.target);

// If target is a dropdown2 then toggle it... if ( $this.hasClass( opts.toggle ) ) {           e.preventDefault;

$this = $this.closest( opts.selector );

if ( ! $this.hasClass( opts.open ) ) {               open.push( $this.addClass( opts.open ) ); }           else {               open.pop.removeClass( opts.open ); }       }    });

})(jQuery);

/* Tester */

$(document).ready(function { $('#neotab-wrapper li:first').addClass('active'); $('#neotab-body > div').hide; $('#neotab-body > div:first').show; $('#neotab-wrapper p').click(function { $('#neotab-wrapper li').removeClass('active'); $(this).parent.addClass('active'); var activeTab = $(this).attr('class'); $('#neotab-body > div:visible').hide; $(activeTab).show; return false; });

});

/* Tester 2 */

$(document).ready(function { $('#feattab-wrapper li:first').addClass('active'); $('#feattab-body > div').hide; $('#feattab-body > div:first').show; $('#feattab-wrapper p').click(function { $('#feattab-wrapper li').removeClass('active'); $(this).parent.addClass('active'); var activeTab = $(this).attr('class'); $('#feattab-body > div:visible').hide; $(activeTab).show; return false; });

});

/* Tester 3 */

$(document).ready(function { $('#portaltab-wrapper li:first').addClass('active'); $('#portaltab-body > div').hide; $('#portaltab-body > div:first').show; $('#portaltab-wrapper p').click(function { $('#portaltab-wrapper li').removeClass('active'); $(this).parent.addClass('active'); var activeTab = $(this).attr('class'); $('#portaltab-body > div:visible').hide; $(activeTab).show; return false; });

});

/* Test 4 */ $(document).ready(function { $('#popuptab-wrapper li:first').addClass('active'); $('#popuptab-body > div').hide; $('#popuptab-body > div:first').show; $('#popuptab-wrapper p').click(function { $('#popuptab-wrapper li').removeClass('active'); $(this).parent.addClass('active'); var activeTab = $(this).attr('class'); $('#popuptab-body > div:visible').hide; $(activeTab).show; return false; });

});

$(document).ready(function { $('#cssmenu li.active').addClass('open').children('ul').show;	$('#cssmenu li.has-sub>p').on('click', function{ $(this).removeAttr('class'); var element = $(this).parent('li'); if (element.hasClass('open')) { element.removeClass('open'); element.find('li').removeClass('open'); element.find('ul').slideUp(200); }		else { element.addClass('open'); element.children('ul').slideDown(200); element.siblings('li').children('ul').slideUp(200); element.siblings('li').removeClass('open'); element.siblings('li').find('li').removeClass('open'); element.siblings('li').find('ul').slideUp(200); }	});

});