Created
December 8, 2010 15:01
-
-
Save crittermike/733375 to your computer and use it in GitHub Desktop.
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(function(){ | |
$('input.button-hover').wrap('<div class="button-wrap"></div>'); | |
$('input.button-hover').hover(function() { | |
$(this).stop().animate({ // Fade the button out when hovered | |
'opacity': 0.01 | |
}, 500) | |
}, function() { | |
$(this).stop().animate({ // Fade it back in on mouseout | |
'opacity': 1 | |
}, 500) | |
}); | |
}) |
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
input.button-hover { | |
background: transparent url(button.png) no-repeat left top; | |
border: none; | |
padding: 0; | |
display: block; | |
height: 30px; /* Set to height of image */ | |
width: 100px; /* Set to width of image */ | |
text-indent: -9999px; | |
font-size: 1px; | |
} | |
.button-wrap { | |
background: transparent url(button-hover.png) no-repeat left top; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment