2011-03-03 40 views
3

我使用modal.js在Joomla 1.5中打開了一個彈出窗口。這是一個SqueezeBox。我試過在彈出窗口中調用關閉這個彈出窗口,但是不能。使用Modal在joomla中無法關閉彈出窗口

在Chrome中它得到一個消息

未捕獲TypeError:無法讀取undefined

+0

你可以發佈代碼嗎? – Gaurav 2011-03-03 09:55:38

+0

一些代碼會很好。你是否試圖在模態窗口中放置一個緊密鏈接? – 2011-03-03 14:00:07

回答

0

深藍的特性 'x' 附加一個close()方法與ID的DIV容器「S盒窗口」。從你的模態內容找到這個元素並執行close()。

如果使用默認的模態方法(模態內容通過ajax接收並直接注入到DOM中)。

document.getElementById('sbox-window')。close();

如果modal處於iframe中

window.parent.document.getElementById( 'S盒窗口')接近();

1

我用Joomla 2.5 modal打開Virtuemart 2「詢問產品」。這裏是我的代碼(我<button>屬性),關閉模式窗口:

onclick="parent.document.getElementById('sbox-btn-close').click();" 
2

請檢查該代碼。

<script type="text/javascript"> 
    window.setTimeout('closeme();', 5000); 
    function closeme() 
    { 
     parent.SqueezeBox.close(); 
    } 
</script> 

希望這將幫助你...

0

只需撥打SqueezeBox.close();而在後端的Joomla工作模態。