denehyg / reveal.js-menu

Slide out menu for reveal.js
https://denehyg.github.io/reveal.js-menu
MIT License
281 stars 76 forks source link

Error load dinamically slide #11

Closed areinoso closed 7 years ago

areinoso commented 8 years ago

I have a function that load slides dinamically, like that

Reveal.addEventListener( 'slidechanged', function( event ) {

    //var idPrevSlide =  event.previousSlide.id;
    //var prevSlide = $("#"+idPrevSlide);
    //prevSlide.html("");

    var idSlide = event.currentSlide.id;
    var slide = $("#"+idSlide);
    var settings = slide.data("settings");

    var data = jQuery.parseJSON(settings);

    if(data.tipo == 'texto'){
        slide.load("slides/texto/"+idSlide+".html");
    }

} ); 

But when I add menu.js to reveal, load don't works. Also I had to change my function, because 'slide.data("settings")' return an string not an object (so I change to jQuery.parseJSON(settings)), but it only happens when I add menu.js.

denehyg commented 7 years ago

Reveal menu doesn't support changes to the slides after initialisation. An interim solution was implemented to delay the menu initialisation until explicitly called (see #37). Also, jquery didn't play nicely with the menu plugin as the ender library used overwrite the $ variable - this has now been fixed in dev (see #30).

I'm closing this for now as I expect you issue is covered in the others linked above. If you still have an issue feel free to reopen it.