Skip to content

Instantly share code, notes, and snippets.

@sajadplusweb
Created August 9, 2013 06:29
Show Gist options
  • Save sajadplusweb/6191550 to your computer and use it in GitHub Desktop.
Save sajadplusweb/6191550 to your computer and use it in GitHub Desktop.

Revisions

  1. sajad created this gist Aug 9, 2013.
    3 changes: 3 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    <div class="box">
    <p>متن توضیح</p>
    </div>
    15 changes: 15 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    $(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"
    });
    });
    })
    16 changes: 16 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    .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;
    }