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

callback #36

Closed
eskema opened this issue Apr 19, 2017 · 3 comments · Fixed by #37
Closed

callback #36

eskema opened this issue Apr 19, 2017 · 3 comments · Fixed by #37

Comments

@eskema
Copy link

eskema commented Apr 19, 2017

Hi,
is there a way to have a callback when a tocbot item is clicked?
I'm trying to trigger something when a link is clicked but it ignores it.
I tried directly with a selector:

$('.tocbot a').on('click', function(){
    // Stuff I want to do
    console.log('callback');
});

And I've also tried to use SmoothScroll callback option:

smoothScrollOptions: {
    easing: 'easeOutQuart',
    offset: 0,
    speed: 600,
    callback: function ( anchor, toggle ) {
        // Stuff I want to do
        console.log('callback');
    }
},

None works. Is there an obvious way I'm missing?

Thanks

@tscanlin
Copy link
Owner

Thanks for creating this issue. This is definitely a bug in tocbot, I'm currently working on a fix.

@tscanlin
Copy link
Owner

tscanlin commented Apr 20, 2017

The callback option for smooth-scroll should work in tocbot version 2.3.2

@eskema
Copy link
Author

eskema commented Apr 20, 2017

Perfect!
Thank you for the quick update.

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

Successfully merging a pull request may close this issue.

2 participants