User:Soxra/monobook.js: Difference between revisions

From the Kingdom Hearts Wiki, the Kingdom Hearts encyclopedia
Jump to navigationJump to search
(Created page with "→‎Recent Changes slider - requires jQuery: $(document).ready(function() { $(".page-Special_RecentChanges a.mw-arr-r, .page-Special_RecentChanges a.mw-arr-d").live("mouseover"...")
 
(Success?)
Line 1: Line 1:
/* Recent Changes slider - requires jQuery */
/* Recent Changes slider - requires jQuery */
$(document).ready(function() {
$(document).ready(function() {
$(".page-Special_RecentChanges a.mw-arr-r, .page-Special_RecentChanges a.mw-arr-d").live("mouseover",function() {
$(".page-Special_RecentChanges span.mw-changeslist-expanded a, .page-Special_RecentChanges span.mw-changeslist-hidden a").live("mouseover",function() {
$(this).attr("onclick","");
$(this).attr("onclick","");
}).live("click",function() {
}).live("click",function() {

Revision as of 17:40, 9 January 2012

/* Recent Changes slider - requires jQuery */
$(document).ready(function() {
	$(".page-Special_RecentChanges span.mw-changeslist-expanded a, .page-Special_RecentChanges span.mw-changeslist-hidden a").live("mouseover",function() {
		$(this).attr("onclick","");
	}).live("click",function() {
		var num = $(this).parent().attr("id").split("-")[3];
 
		var $openarrow = $("#mw-rc-openarrow-"+num);
		var $closearrow = $("#mw-rc-closearrow-"+num);
		var $subentries = $("#mw-rc-subentries-"+num);
 
		$openarrow.css("visibility","visible").removeClass("mw-changeslist-hidden mw-changeslist-expanded");
		$closearrow.css("visibility","visible").removeClass("mw-changeslist-hidden mw-changeslist-expanded");
		$subentries.css("visibility","visible").removeClass("mw-changeslist-expanded");
 
		if ($subentries.is(":hidden") || $subentries.hasClass("mw-changeslist-hidden")) {
		  $openarrow.hide();
		  $closearrow.show();
		  $subentries.hide().removeClass("mw-changeslist-hidden").slideDown(300);
		} else {
		  $openarrow.show();
		  $closearrow.hide();
		  $subentries.slideUp(300);
		}
 
		return false;
	});
});