MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
(Handle .hover-link) |
m (Fix typo) |
||
Line 8: | Line 8: | ||
for (var i=0; i<classes.length; i++) | for (var i=0; i<classes.length; i++) | ||
{ | { | ||
if (classes[i].indexOf(" | if (classes[i].indexOf("link-") != -1) | ||
{ | { | ||
$("span."+classes[i]).toggleClass("hover"); | $("span."+classes[i]).toggleClass("hover"); |
Revision as of 13:36, March 28, 2016
$(document).ready(function(){ $('span.hover-link').hover(function(e){ var classes = $(this).attr("class").split(/\s+/); $(this).toggleClass("hover"); console.log(classes); for (var i=0; i<classes.length; i++) { if (classes[i].indexOf("link-") != -1) { $("span."+classes[i]).toggleClass("hover"); } } }); });