Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Handler #17

Closed
adyz opened this issue Feb 24, 2011 · 1 comment
Closed

Add Handler #17

adyz opened this issue Feb 24, 2011 · 1 comment

Comments

@adyz
Copy link

adyz commented Feb 24, 2011

Can we already add an handler somewhere else beside the image itself?
Something like arrows or scroll bar or another thumbnail/div.
Thank you!
Sorry for my English!

@pisi
Copy link
Owner

pisi commented Mar 4, 2011

Hi,

internally Reel uses event and you can .bind to any of them and let your handler react to the event. Particulary, you will be interested in "frameChange" event, which is trigged every time frame is changed. You won't get the frame number as handler parameter. Instead you can access .data on the element itself. Reel stores everything in element's data. Look for the key "frame".

$('#your_image').bind('frameChange', function(){
    // Inside this handler you can do whatever you want
    // to any element anywhere on page.
    // `this` is the Reel instance element
    $(this).data('frame'); // returns current frame number
});

Supposed you have Reel already instantiated by $('#your_image').reel({ ... }).

Hope this helps. If not, please, feel free to reopen this issue.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants