...

View Full Version : Close other popups



icklechurch
06-22-2009, 09:56 AM
Hi,

Is there anyway to close all popups in a html script?

Thanks,

Philip M
06-22-2009, 10:46 AM
Yes.

See http://www.tek-tips.com/faqs.cfm?fid=4740

Store the name in an array when you open the popups, and loop through the array to close all open windows.


<script type = "text/javascript">

document.activePopup = new Array;

function openWindow(sUrl,sName,sProps){
document.activePopup.push(window.open(sUrl,sName,sProps))
}

function closePopup(){
for(var x=0;x<document.activePopup.length;x++)
document.activePopup[x].close()
}

</script>


"The whole aim of practical politics is to keep the populace alarmed (and hence clamorous to be led to safety) by menacing it with an endless series of hobgoblins, all of them imaginary." - H.L. Mencken 1880-1956, American Editor, Author, Critic, Humorist



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum