1
嗨jQueryMobile有一個事件對pagecreate,但它不與創建對話框(對話框頁面在同一頁面中內嵌有data-role="page"
)jQuery Mobile的pagecreate事件
$(document).delegate("pagecreate", "#foo-dialog", function() {
console.log("dialog-opened");
});
嗨jQueryMobile有一個事件對pagecreate,但它不與創建對話框(對話框頁面在同一頁面中內嵌有data-role="page"
)jQuery Mobile的pagecreate事件
$(document).delegate("pagecreate", "#foo-dialog", function() {
console.log("dialog-opened");
});
我有工作代碼,其中pagecreate/pageshow在顯示對話框時被調用,也許你的JS在錯誤的位置?如果你AJAX過渡到這個頁面,你的頭標籤中的任何JS都不會被拉入。
你曾經爲此找到過答案嗎? –
我有一個類似的問題,但我的錯誤是我委託事件處理程序與一個錯誤的選擇器。棘手的(並且沒有記錄的)是,當你打開一個頁面作爲對話框時,它沒有'data-role ='page''但是'data-role =「dialog」'。 – Ignitor