You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll add an option for an event callback (e.g. on animation complete) to be fired. You can then handle the logic there. Thanks for bringing this up. It only makes sense to have something like this to compliment the start() and stop(). Let me know if you have any suggestions on this.
This is just a quick update to your issue. I have added an option for an event callback (as mentioned in my previous comment) and it is named complete -- see 087facc. complete will be fired after every new phrase is introduced. The this context of complete will be that of the plugin's instance and hence, you may access its settings and methods using this.
With your scenario in mind, here are a few examples of how you may stop the animation at a certain phrase or index:
$("#js-rotating").Morphext({complete: function(){// 1. Stop if phrase index is 3if(this.index===3){this.stop();}// 2. Stop if phrase is "Stop here" by retrieving the current phrase through its indexif(this.phrases[this.index]==="Stop here"){this.stop();}// 3. Stop at the last phraseif(this.index===this.phrases.length-1){this.stop();}}});
I hope it helps!
Let me know if you have any other questions or problems.
I'll try my best to help you get it working.
Stop the animation okay, but you can choose which word stoper?
For example if I want the animation will stop on the last word, how do I do?
The text was updated successfully, but these errors were encountered: