jerohm
05-29-2003, 05:41 PM
I am VERY new at this so be kind please...
What I am trying to accomplish is to open new separate windows with large images as the user clicks on thumbnails, which WORKS. I experience a problem processing 'OnUnLoad' issuing the multiple window.close() in a row (or timing...).
This code hangs my IE6.0.2800.1106 (MOST of the time) when I leave the page (i.e., OnUnLoad - the BACK button, Home, new address ...) unless
1) viewWinId == 1 (Only ONE window was opened)
2) I manually close all opened windows FIRST
3) I uncomment the alert('test')
Any suggestions???
Thank You
j
var viewWins = new Array();
var viewWinId = 0;
function Viewer(imagesrc) {
winFeatures= "status=yes,toolbar=no,scrollbars=no,resizable=yes,width=200,height=200";
viewWins[viewWinId++]=
window.open(imagesrc, "_blank", winFeatures);
}
function closeViews() {
for(i= 0; (i < viewWinId); i++) {
if(( viewWins[i] != null ) && !viewWins[i].closed ) {
viewWins[i].close();
// alert('test');
}
}
}
<BODY background="" bgColor=#000000 OnUnLoad="closeViews();">
What I am trying to accomplish is to open new separate windows with large images as the user clicks on thumbnails, which WORKS. I experience a problem processing 'OnUnLoad' issuing the multiple window.close() in a row (or timing...).
This code hangs my IE6.0.2800.1106 (MOST of the time) when I leave the page (i.e., OnUnLoad - the BACK button, Home, new address ...) unless
1) viewWinId == 1 (Only ONE window was opened)
2) I manually close all opened windows FIRST
3) I uncomment the alert('test')
Any suggestions???
Thank You
j
var viewWins = new Array();
var viewWinId = 0;
function Viewer(imagesrc) {
winFeatures= "status=yes,toolbar=no,scrollbars=no,resizable=yes,width=200,height=200";
viewWins[viewWinId++]=
window.open(imagesrc, "_blank", winFeatures);
}
function closeViews() {
for(i= 0; (i < viewWinId); i++) {
if(( viewWins[i] != null ) && !viewWins[i].closed ) {
viewWins[i].close();
// alert('test');
}
}
}
<BODY background="" bgColor=#000000 OnUnLoad="closeViews();">