barraq / deck.ext.js

Provide extensions, themes and use cases for deck.js
17 stars 7 forks source link

Click Event #4

Closed tjameswhite closed 10 years ago

tjameswhite commented 11 years ago

I'm trying to modify the slides so that the user can click a link to bring up the ToC instead of relying just on pressing 't'. I'm just not having any luck figuring out how to envoke the ToC toggle from a click event. Doesn't seem like it would be that hard...

tjameswhite commented 11 years ago

Well, I managed to get something working finally; stumbled onto .delegate and that seems to have done the trick. If anyone has a better idea, I'd love to see it.

$d.delegate('#toc', 'click', function(e){ $deck; e.preventDefault(); });

barraq commented 10 years ago

Hi @tjameswhite, simply calling $.deck('showToc'); or $.deck('toggleToc'); will do the trick. You can then trigger this call from whatever events.