Created
January 29, 2014 03:27
-
-
Save cdnsteve/8681316 to your computer and use it in GitHub Desktop.
jQuery Rollovers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Image RollOver Effect | |
* ======================================================================== | |
*/ | |
jQuery(".rollover").hover( | |
function () { | |
var iconName = jQuery(this).attr("src"); | |
var rollover = iconName.replace( /active/, 'rollover' ); | |
jQuery(this).attr({ src: rollover }); | |
}, | |
function () { | |
var iconName = jQuery(this).attr("src"); | |
var static = iconName.replace( /rollover/, 'active' ); | |
jQuery(this).attr({ src: static }); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment