...

View Full Version : po-up window focus problem in explorer for PC



tamcole
01-26-2006, 10:28 PM
Me again - and thanks for previous advice. Here's the latest (and last, I hope).

I have a pop-up window which stays open and gets used for new images, called by links from the main page. I need it to come to the front of the main window when each time images load. It works fine on Safari, Explorer, Opera and Firefox for the Mac, but Explorer on the PC isn't working; it fails to even open the pop-up in the first place, let alone bring it to the front on a second visit.

Any solutions?

Heres the code I've used so far, found on a help-site:

function windowOpener(url, name, args) {
if (typeof(popupWin) != "object"){
popupWin = window.open(url,name,args);
} else {
if (!popupWin.closed){
popupWin.location.href = url;
} else {
popupWin = window.open(url, name,args);
}
}
popupWin.focus();
}

with

<a href="#" onClick=windowOpener("weblogo.html","images","toolbar=no,location=no,directories=no,status=no,menubar=noscrollbars=yes,resizable=yes,width=600,hei ght=400")>link to pop-up window</a>

glenngv
01-27-2006, 03:37 AM
var popupWin;
function windowOpener(url, name, args) {
if (!popupWin || popupWin.closed){
popupWin = window.open(url, name, args);
}
popupWin.focus();
return false; //cancel href action
}
...
<a href="weblogo.html" target="images" onclick="return windowOpener(this.href, this.target, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=600, height=400');">link to pop-up window</a>
I made it so that the link will still open the page even if js is disabled.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum