Can not close popup window using Modal in joomla
I have opened an popup window in Joomla 1.5 using modal.js. It's a SqueezeBox. I'm tried call close this popup on popup content but can't.
In Chrome it get an message
Unca开发者_开发问答ught
TypeError
: Cannot read property 'x
' ofundefined
Please check this code.
<script type="text/javascript">
window.setTimeout('closeme();', 5000);
function closeme()
{
parent.SqueezeBox.close();
}
</script>
Hope this will helps you...
I used Joomla 2.5 modal for open Virtuemart 2 "ask about product". And here is my code (for my <button>
attribute) to close modal window:
onclick="parent.document.getElementById('sbox-btn-close').click();"
Squeezebox attaches a close() method to the div container with id 'sbox-window'. From your modal content find this element and execute close().
If using default modal method (Modal content received through ajax and injected directly into the DOM).
document.getElementById('sbox-window').close();
If modal is in a iframe
window.parent.document.getElementById('sbox-window').close();
Just call SqueezeBox.close();
while operating with modals in Joomla backend.
精彩评论