Skip to content

Instantly share code, notes, and snippets.

@sajadplusweb
Created August 9, 2013 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajadplusweb/6191550 to your computer and use it in GitHub Desktop.
Save sajadplusweb/6191550 to your computer and use it in GitHub Desktop.
A CodePen by sajad. hover effect
<div class="box">
<p>متن توضیح</p>
</div>
$(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"
});
});
})
.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