文章詳情頁
javascript - 在iframe子頁面 通過window.parent.document打開父頁面的modal層不能正常關(guān)閉
瀏覽:162日期:2023-02-14 10:45:29
問題描述
大家好 我想問一下 在iframe子頁面 通過window.parent.document打開父頁面的modal層,這樣父頁面的modal關(guān)閉方法$('#modal').modal('hide')不能正常關(guān)閉,有沒有大神知道這是什么原因
問題解答
回答1:你在子頁面里$('#modal').modal('hide')肯定不能關(guān)閉呀!你可以在子頁面里調(diào)用父頁面的一個(gè)方法,這個(gè)方法里寫$('#modal').modal('hide')!回答2:
$(’#id’, window.parent.document).modal(’hide’);
回答3:最后采取了一種不太好的方法暫時(shí)解決,先show再hide,$('#modal').modal('show').modal('hide'),這樣可以解決,只是彈出層關(guān)閉的時(shí)候會因?yàn)閟how閃一下,還沒有找到好的解決辦法
標(biāo)簽:
JavaScript
上一條:javascript - vue路由-瀏覽器返回按鈕重復(fù)的返回之前點(diǎn)擊過的頁面怎么辦?下一條:javascript - ui-router AngularJS url顯示正常 頁面沒有變化?
相關(guān)文章:
1. vue計(jì)算屬性怎么樣與for結(jié)合使用2. angular.js - vue/react 渲染內(nèi)容抖動3. node.js - 如何使用mongoose連接數(shù)據(jù)庫中已經(jīng)存在的一個(gè)集合。4. html5 - 如何實(shí)現(xiàn)圖中的刻度漸變效果?5. css - div外層有一圈白色6. node.js - version3的generic-pool問題7. javascript - Object.create(null) 和 {} 區(qū)別是什么8. javascript - vue v-for循環(huán),子循環(huán)內(nèi)要取到父循環(huán)的鍵值,如何做到?9. redis - 不知道國內(nèi)有多少用Python + CouchDB的朋友,談一下經(jīng)驗(yàn)。。。10. PHP能實(shí)現(xiàn)百度網(wǎng)盤的自動化么?
排行榜

熱門標(biāo)簽