8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jQueryの.animate()と.fadeIn()を同時に動かしたい時

Posted at

フェードインしながらちょっと下に移動して欲しい時に、
フェードインが終わってから下に動いちゃって困った。

そこで

$(function() {
 $('.item_gnavi').on('mouseenter', function() {
    $(this).find('.contents').fadeIn(400).animate({
      'top': '70px'
    },{
      duration: 500,
      queue: false //←★ココがqueue
    });
  });
});

デモページ

オプション指定として、queueをfalseに設定すると(初期値はtrue)、
キューに追加せずに即座に実行してくれる。
上記はanimateで設定したが、fadeInの方でも設定可。

.animate()
http://api.jquery.com/animate/

8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?