私のプラグインからプライベートメソッド_scrollMeを呼び出そうとしていますが、それは関数ではないというエラーが発生し続けます。jquery/jquery mobile plugin - widget - プライベートメソッドの呼び出しが機能しません
誰かが私が間違っていることを教えてもらえますか?ありがとう!
(function($, window, undefined){ $.widget("mobile.multiview", $.mobile.widget, { _create: function() { this._morph(); }, _morph: function() { $('div[data-role="page"]').live('pagebeforeshow.scroll', function(event){ var $page = $(this); if ($page.data('scrollable', 'Off')) { $page._scrollMe(); // this doesn't fire } }); }, _scrollMe: function() { alert ("scrollMe"); } }); // initialize $(document).bind("pagecreate", function() { $(document).multiview(); }); })(jQuery,window);
は動作しません。私はウィンドウ(= "this")でプラグインを呼び出していて、次に私はpageBeforeShowをリッスンして "this"を再使用しているからでしょうか? – frequent