0

これは重複としてクローズされる可能性が高いことはわかっていますが、同様の質問のすべてで私の問題に対する答えを見つけることができませんでした.

animate()マウス ホバー時に (ご想像のとおり、jQuery を使用して) ページ上の要素を表示したい。私がしたことは:

$('blockquote').hover(function() {
    console.log($(this));
    $(this).animate({textSize: '+=10px'}, 500);
}, function() {
    $(this).animate({textSize: '-=10px'}, 500);
});

はこれconsole.logをログに記録します:

[blockquote#daily_quote, context: blockquote#daily_quote, jquery: "1.9.1", constructor: function, init: function, selector: ""…]

内部の両方の関数hoverが呼び出され、$(this)ログに記録されますが、何もアニメーション化されません。

4

2 に答える 2

5

使用fontSize:

$('blockquote').hover(function() {
    // console.log($(this));
    $(this).animate({fontSize: '+=10px'}, 500);
}, function() {
    $(this).animate({fontSize: '-=10px'}, 500);
});
于 2013-03-18T11:37:39.203 に答える
1
This may be help you.
$('blockquote').hover(function() {

        $(this).animate({left: '+=10px'}, 700);
    }, function() {
        $(this).animate({left: '-=10px'}, 700);
    });

左の代わりに任意のプロパティを使用できます

于 2013-03-18T11:58:58.620 に答える