Created
June 12, 2012 20:56
-
-
Save rpearce/2920085 to your computer and use it in GitHub Desktop.
Sexy Facebook and Twitter icon CoffeeScript, assuming you have a sprite with the up and hover for each image type.
This file contains hidden or 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
$(document).ready -> | |
$('.external-fb-link').css('opacity','0.5') | |
$('.external-tw-link').css('opacity','0.5') | |
$('.external-fb-link').live('mouseenter', -> | |
$(this) | |
.addClass('sprite-icon-facebook-fancy-png') | |
.removeClass('sprite-icon-facebook-fancy-up-png') | |
.animate | |
opacity: 1 | |
, | |
duration: 300 | |
).live('mouseleave', -> | |
$(this) | |
.removeClass('sprite-icon-facebook-fancy-png') | |
.addClass('sprite-icon-facebook-fancy-up-png') | |
.animate | |
opacity: 0.5 | |
, | |
duration: 300 | |
) | |
$('.external-tw-link').live('mouseenter', -> | |
$(this) | |
.addClass('sprite-icon-twitter-fancy-png') | |
.removeClass('sprite-icon-twitter-fancy-up-png') | |
.animate | |
opacity: 1 | |
, | |
duration: 300 | |
).live('mouseleave', -> | |
$(this) | |
.removeClass('sprite-icon-twitter-fancy-png') | |
.addClass('sprite-icon-twitter-fancy-up-png') | |
.animate | |
opacity: 0.5 | |
, | |
duration: 300 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment