Check once a function is complete

后端 未结 2 1628
离开以前
离开以前 2021-01-23 19:42

I have a lit of offsets for a div that I load when a link is clicked to give a comic book style effect. Each offset activates other animations to give a more dynamic feel.

2条回答
  •  囚心锁ツ
    2021-01-23 20:05

    If you utiilise the .data('obj',{currentPosition:index}); approach, you can create a .data() object on an element and have your animations query it to see 'where' they are from 0 to however many items you need in your comic book sequence. Base your animations on the index from 0=>however many and then update the currentPosition when your animation is finished using the callback parameter in the animation.

    Would that direction help? If you can give some example code (simple or otherwise) we might be able to see a way to tie it in?

提交回复
热议问题