Created
August 9, 2013 06:29
-
-
Save sajadplusweb/6191550 to your computer and use it in GitHub Desktop.
A CodePen by sajad. hover effect
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
<div class="box"> | |
<p>متن توضیح</p> | |
</div> |
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(){ | |
$('.box').mouseenter(function(){ | |
$(this).animate({ | |
"width" : "170px" | |
}); | |
$('p').delay(1000).animate({ | |
"opacity" : "1" | |
},200); | |
}).mouseleave(function(){ | |
$('p').css("opacity" , "0"); | |
$(this).animate({ | |
"width" : "120px" | |
}); | |
}); | |
}) |
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
.box{ | |
width:120px; | |
height:100px; | |
background:red; | |
transition:width 0.5s; | |
float: left; | |
position: relative; | |
} | |
p{ | |
font-family: tahoma; | |
color:#fff; | |
position: absolute; | |
top:20px; | |
right:0; | |
opacity:0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment