I just tried this. It worked on first click, but POP did not regain focus on second click (so it remained hidden behind larger window). How would focus() be resolved?
Recently had the same problem (losing focus) with old myopen.js. The mypop.js regains focus for POP. As used in http://www.auntnini.com/sites . http://www.jacquimorgan.com, http://www.josephdenaro.com, http://www.chanit.com.
Code:
/*myopen*/
// JavaScript Document
// separate window for link
// CG215 separate window for link
function myopen(url)
{ window.open (url, 'links', 'toolbar=0,location=1,directories=0,status=0,menubar=0,scrollbars=auto,resizable=yes,dependent=yes,width=400,height=400'); window.blur();
}
var links; //to avoid "undefined" message
// JavaScript Unleashed's onUnload event handler
function clean() {
if (links != null) { links.close() };
}
==============
/*mypop*/
/*in BODY <a href="#nogo" onclick="loadpage('../things/___.jpg')">TEXT</a>*/
// JavaScript Document
var mypop=null;
function loadpage(url) {
if ((!mypop) || (mypop.close)) {
mypop = window.open (url, 'mypop', 'width=400px,height=375px,toolbar=0,resizable=1,screenx=0,left=20,screeny=0,top=20');
} else { mypop.document.location.href=url; }
mypop.focus(); return true;
}
Also I read something about new/open window "features" not being supported in HTML5/CSS3?
Bookmarks