I create a presentation with this javascript framework http://lab.hakim.se/reveal-js/#/ and when certain slide is appearing I want to execute function stats(), which display som
To answer Philippe Leefsma's question: you can use bind() to pass arguments, like so:
drawDiagramOnSlide.bind(
null,
slideName,
slideEl.querySelector('.diagram')
));
Assuming drawDiagramOnSlide looks like this:
function drawDiagramOnSlide(_slideName, _diagramEl, _event) {...}
The bind call will create a function that calls drawDiagramOnSlide with the correct slide name and element (in my case, a div with class diagram inside the slide ).