[英]Can not close popup window using Modal in joomla
我使用modal.js在Joomla 1.5中打開了一個彈出窗口。 這是一個SqueezeBox。 我嘗試在彈出內容上調用關閉此彈出窗口,但不能。
在Chrome中,它會收到一條消息
未捕獲的
TypeError
:無法讀取undefined
屬性“x
”
請檢查此代碼。
<script type="text/javascript">
window.setTimeout('closeme();', 5000);
function closeme()
{
parent.SqueezeBox.close();
}
</script>
希望這會對你有所幫助......
我使用Joomla 2.5模式打開Virtuemart 2“詢問產品”。 這是我的代碼(對於我的<button>
屬性)關閉模態窗口:
onclick="parent.document.getElementById('sbox-btn-close').click();"
只需調用SqueezeBox.close();
在Joomla后端使用模態操作時。
Squeezebox將一個close()方法附加到id為'sbox-window'的div容器中。 從你的模態內容中找到這個元素並執行close()。
如果使用默認模態方法(通過ajax接收的模態內容並直接注入DOM)。
。的document.getElementById( 'S盒窗口')接近();
如果modal在iframe中
。window.parent.document.getElementById( 'S盒窗口')接近();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.