I have a need to use a lot of pop ups to provide greater detail into items users are interested in.
The problem is the percentage of time that a browser will block these pop ups.
I would need to find a way to do one or both of two things:
1.) Find a way to show pop ups like with lightbox that will not be blocked by browsers without greatly hindering page load time
2.) Provide a JavaScript / JQuery alert that can detect when a pop up has been blocked by a browser and notify a user through an alert along with a custom message written by me
Anyone familiar with some JavaScript coding that will do this or if lightbox is a practical solution without hindering page load time. There is likely to be anywhere from 10-30 different pop ups on a given page.
I'm not an"expert" on this, but think pop-up will work if user initiates it by clicking link. (Of course, IE will block image rollovers if you don't click message at top of view-port.)
There is always target="_blank" ("_new" loses focus)
In any event, here are two scripts I've used for years. Recently, the "myopen" window has lost focus after first pop, but "loadpage" script keeps focus after several pops. Don't know what will happen if, indeed, HTML5 does not support new window "features" such as size?
Code:
// MYOPEN JavaScript Document
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() };
}
===================
// LOADPAGE JavaScript Document
/*in BODY <a href="#nogo" onclick="loadpage('../things/___.jpg')">TEXT</a>*/
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;
}
Bookmarks