Created
September 30, 2013 20:12
-
-
Save psflannery/6769460 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
/* | |
<a href="#" class="arrow">Arrow</a> | |
*/ | |
.arrow { | |
display: inline-block; | |
position: relative; | |
text-indent: -9999px; | |
width: 36px; | |
height: 36px; | |
background: url(sprites.png) no-repeat; | |
} | |
.arrow:after { | |
content: ""; | |
position: absolute; | |
top: 0; left: 0; bottom: 0; right: 0; | |
background: url(sprites.png) no-repeat; | |
background-position: -50px 0; | |
opacity: 0; | |
-webkit-transition: opacity 0.5s; | |
-moz-transition: opacity 0.5s; | |
-o-transition: opacity 0.5s; | |
} | |
.arrow:hover:after { | |
opacity: 1; | |
} |
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
//<a href="#" class="arrow">Arrow<span></span></a> | |
/* | |
.arrow { | |
display: inline-block; | |
position: relative; | |
text-indent: -9999px; | |
width: 36px; | |
height: 36px; | |
background: url(sprites.png) no-repeat; | |
} | |
.arrow span { | |
position: absolute; | |
top: 0; left: 0; bottom: 0; right: 0; | |
background: url(sprites.png) no-repeat; | |
background-position: -50px 0; | |
} | |
*/ | |
$(function() { | |
$(".arrow") | |
.find("span") | |
.hide() | |
.end() | |
.hover(function() { | |
$(this).find("span").stop(true, true).fadeIn(); | |
}, function() { | |
$(this).find("span").stop(true, true).fadeOut(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment