MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus 100 prozent erneuerbar - Wiki
Zur Navigation springen Zur Suche springen
Zeile 2: Zeile 2:
 
//MAKE MAINMENU LINKS ACTIVE
 
//MAKE MAINMENU LINKS ACTIVE
 
jQuery(document).ready(function(){
 
jQuery(document).ready(function(){
var currUri = document.location.href;
+
var currUrl = document.location.href;
 
console.log("document.location.href :: ");
 
console.log("document.location.href :: ");
console.log(currUri);
+
console.log(currUrl);
 
jQuery("#p-navigation .vector-menu-portal a").each(function(){
 
jQuery("#p-navigation .vector-menu-portal a").each(function(){
 
var linkUrl = jQuery(this).attr("href");
 
var linkUrl = jQuery(this).attr("href");
if(currUri.indexOf(linkUrl) !== -1){
+
console.log(linkUrl);
 +
if(currUrl.indexOf(linkUrl) !== -1){
 
jQuery(this).addClass("active");
 
jQuery(this).addClass("active");
 
}
 
}
 
});
 
});
 
});
 
});

Version vom 3. März 2021, 19:48 Uhr

/* Das folgende JavaScript wird für alle Benutzer geladen. */
//MAKE MAINMENU LINKS ACTIVE
jQuery(document).ready(function(){
	var currUrl = document.location.href;
	console.log("document.location.href :: ");
	console.log(currUrl);
	jQuery("#p-navigation .vector-menu-portal a").each(function(){
		var linkUrl = jQuery(this).attr("href");
		console.log(linkUrl);
		if(currUrl.indexOf(linkUrl) !== -1){
			jQuery(this).addClass("active");
		}
	});
});