0

I'm using SmoothState for a web app, but for some reason, it appears most the callback options do not fire at all. The only callback option that seems to go through is onStart.

Here's my code:

    ;(function ($) {
    'use strict';
    var $body    = $('html, body'),
        content  = $('#container').smoothState({

            prefetch: true,
            pageCacheSize: 10,
            debug: true,

            onReady: {
                duration: 0,
                render: function($container, $newContent) {
                    console.log('onReady');
                    $container.html($newContent);
                    window.initPlugins();
                },
            },
            onAfter: {
                render: function($container, $newContent){
                    console.log('onAfter');
                    window.initPlugins();
                }
            },

        }).data('smoothState');
})(jQuery);

Am I doing something wrong?

Kirk Hadden
  • 59
  • 1
  • 6

1 Answers1

0

I have the same problem (and still didn't solved it). But from the documentation it should be (without the render):

onAfter: function($container, $newContent) {}
  • Right. I've actually got it working now, using this code: `onAfter : function(url, $container, $content) { // Code }` – Kirk Hadden Oct 03 '16 at 13:23