matthewlein / jQuery-jSlots

jQuery slot machine insanity! Turns any list into a slot machine (you provide the insanity)
184 stars 95 forks source link

How to call it on a jquery function #16

Open Aggreyluts opened 7 years ago

Aggreyluts commented 7 years ago

Instead of using the spin event and spinner how can you call it in a functions

johhansantana commented 7 years ago

any luck on this?

matthewlein commented 7 years ago

Looks like a reference to the jSlots base object is set on $el.data("jSlots", base).

https://github.com/matthewlein/jQuery-jSlots/blob/e87ce43045ed3f7718e9951ffb15826ba298694f/jquery.jSlots.js#L19

So after instantiating it, you should be able to make calls directly using that. Something along the lines of this:

var $slot = $('.slot').jSlots();
$slot.data('jSlots').playSlots();