MediaWiki:Common.js: Difference between revisions

From Hidden Palace
Jump to navigation Jump to search
mNo edit summary
m (Fiddle with qtip)
Line 22: Line 22:
       style: {
       style: {
           classes: 'qtip-tipsy'
           classes: 'qtip-tipsy'
      },
      content: {
          title: function(event, api) {
              return $(this).attr('data-title');
          }
       }
       }
     });
     });
});
});

Revision as of 14:15, March 28, 2016

$(document).ready(function(){
    $('span.hover-link').hover(function(e){
        var classes = $(this).attr("class").split(/\s+/);

        for (var i=0; i<classes.length; i++)
        {
            if (classes[i].indexOf("link-") != -1)
            {
                if (e.type == "mouseenter")
                {
                    $("span."+classes[i]).addClass("hover");
                }
                else if (e.type == "mouseleave")
                {
                    $("span."+classes[i]).removeClass("hover");
                }
            }
        }

    });
    $('span.hex-snippet span[title!=""]').qtip({
      style: {
          classes: 'qtip-tipsy'
      },
      content: {
          title: function(event, api) {
              return $(this).attr('data-title');
          }
      }
    });
});