3

我正在尝试在 上滑动文本hoverimg/text其他 div 也应该与div.

我已经实现了滑动效果,但无法div沿路径滑动 s。这是演示

4

2 回答 2

3

尝试这个:

$('.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/

于 2012-10-18T08:04:57.600 回答
0

尝试这个

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

http://jsfiddle.net/mqzuD/8/

希望这是你想要的。

于 2012-10-18T07:41:33.860 回答