1

私はIKEAのようなアニメーションを作るためにこのチュートリアルに従っています:

http://static.buildinternet.com/live-tutorials/interactive-picture/index.html

私が抱えている問題は、誰かが画像の上にカーソルを合わせると、情報が左から右ではなく、右から左に拡大するようにしたいということです。

jsfiddleの例を次に示します。http: //jsfiddle.net/NEHZU/1/

これはjsfiddleのコードです:

CSS:

.more{ position:absolute; width:17px; height:17px; background:url('dim.png'); padding:2px; text-align:left; overflow:hidden; }

.more span{ position:absolute; left:32px; width:160px; padding:0px 0 0 0px; color:#000; font:bold 13px Lucida Grande, Arial, sans-serif;  }

#test{ top:50px; left:213px;}

HTML:

<div class="more" id="test">

            <a href="http://www.google.com"><img src="http://buzport.com/wp-content/uploads/2011/07/land-phone-17x17px.gif"/></a>
            <span>random text</span>

        </div>​

JavaScript:

$(".more").hover(function(){
                $(this).stop().animate({width: '225px' },200).css({'z-index' : '10'}); 
            }, function () {
                $(this).stop().animate({width: '17px', height: '17px' }, 200).css({'z-index' : '1'});
              });​

タイトルを更新して、左から右ではなく右から左に変更

4

2 に答える 2

1

これをお探しですか?

$(".more").hover(function(){
    $(this).stop()
        .animate({
            width: '225px', 
            left: $(this).find('span').width() 
        }, 200)
        .css({ 'z-index' : '10' }); 
    }, function () {
    $(this).stop()
        .animate({
            width: '17px', 
            left: '213px', 
            height: '17px' 
    }, 200)
    .css({'z-index' : '1'});
});​

http://jsfiddle.net/NEHZU/38/

于 2012-02-20T23:45:20.483 に答える
0
$(".etc").hide();

$( "。more")。hover(function(){

$(".etc").animate({
    "marginLeft": "-=80px"
}, 200);
$(".etc").show();

}、 働き() {

$(".etc").animate({
    "marginLeft": "+=80px"
}, 200);

$(".etc").hide();

}); </ p>

あなたは私のcssで少し遊んでみるべきです、私はそうは思いません、それについては申し訳ありません:))

http://jsfiddle.net/zxJtu/

于 2012-02-21T00:22:30.137 に答える