0
0

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 3 years have passed since last update.

UIkitのswitcherで今のindexと次のindexを取得する

Posted at

UIkitのSwitcherを利用していてコンテンツが入れ替わる際に,今よりも前のコンテンツに移動するのか後のコンテンツに移動するのかを判定したい場合があると思います.

そのような際に現在表示されているコンテンツのindexと,次に表示されるコンテンツのindexを下記のように取得することができます.

document.addEventListener('beforehide', function(e) {
    let now_index = UIkit.util.index(e.target);
    let next_index = e.detail[0].index();
});

参考サイト

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?