jQuery slide div在悬停在IMG /文本的悬停时从左到右



我试图在img/texthover上滑动文本,另一个DIV也应与div一起滑动。

我已经达到了滑动效果,但无法沿着路径滑动div。这是演示。

尝试以下:

$('.holdingbox').hover(function(){
        $('.rightbox').animate({width: '90px'}, 1000)
    }, function(){
        $('.rightbox').animate({width: '0'}, 1000)
    });

html

<div class="holdingbox">
 <span class="leftbox">Stuff</span>
 <span class="rightbox">
     <span class="content">Stuff to reveal</span>
 </span>
</div>
<div class = "box">Text</div>

CSS

.rightbox {
    position: relative;
    display:inline-block;
    overflow:hidden;
    width:0;
    height:30px;
    vertical-align:top;
}
.content{
    width:100px;
    position:absolute;
    left:0;
    top:0;
}

检查此http://jsfiddle.net/mqzud/10/

尝试此

$('div.holdingbox').bind("mouseenter", function() {
      $(this).find('span').animate({
             "left": "+=5px",
                "opacity" : "show"
              }, {
            duration: 1000
      });   
 });

http://jsfiddle.net/mqzud/8/

希望这是您想要的。

最新更新