Request documentation for mouseover / hover effect

Fragment of a discussion from Project:Support desk
Jump to: navigation, search

For personal scripts Special:MyPage/common.js or Special:Preferences#mw-prefsection-rendering or site wide see MediaWiki:common.js et al.

Allen4names (talk)14:11, 3 June 2012

Ok, I've copied the code to User:Cavila/common.js, but I'm unsure what to put after "src".

Cavila MW 1.17, MySQL 5.5.23, Php 5.3.10, SMW 1.7.106:54, 4 June 2012

First get rid of the HTML code and comment out the javascript. I am using the English Wikipedia logo as a replacement in the following example.

/*
$(document).ready(function(){
    $(".button").hover(function() {
        $(this).attr("src","//upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png");
            }, function() {
        $(this).attr("src","//upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png");
    });
});
*/

Uncoment out the script (remove '/*' and '*/') when it is ready and let me know if this works.

Allen4names (talk)16:18, 4 June 2012