Created
December 10, 2013 18:20
-
-
Save jaybuys/7895346 to your computer and use it in GitHub Desktop.
Simple jQuery function to add rollover functionality to promo boxes. Adds/Removes an "over" class to the main container for CSS styling and has a click function so that the entire promo box will be clickable to the hyperlink housed inside.
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
$(function() { | |
// Promo rollovers | |
$('.promo').mouseover(function() { | |
$(this).addClass('over'); | |
}).mouseout(function() { | |
$(this).removeClass('over'); | |
}).click(function() { | |
location.href = $(this).find('a').attr('href'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment