簡體   English   中英

不觸發SmoothState回調

[英]SmoothState Callbacks not firing

我正在為Web應用程序使用SmoothState,但是由於某些原因,大多數回調選項似乎根本無法觸發。 似乎經歷的唯一回調選項是onStart。

這是我的代碼:

    ;(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);

難道我做錯了什么?

我有同樣的問題(但仍然沒有解決)。 但是從文檔來看,它應該是(沒有渲染):

onAfter: function($container, $newContent) {}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM