Arttse / jquery.auto-text-rotating

jQuery plugin to change/rotation of text or html, single or group, automatically with a separator
MIT License
6 stars 4 forks source link

Destroy method #6

Closed mrkenng closed 6 years ago

mrkenng commented 6 years ago

I've been using your script for a while and really liked it. Was wondering if there's any destroy method? Or stop does the job in this case? The reason because I'm using it with react and wanted to destroy on unmount.

Arttse commented 6 years ago

Hi @mrkenng! Thanks for using this script. For destroy you can use stop method, in React.js like that:

componentWillUnmount() {
  $('.element').atrotating('stop');
}

Also you can try with settings

mrkenng commented 6 years ago

Thank you @Arttse ! Just making sure :) Great work by the way!