You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.7 KiB
JavaScript
54 lines
1.7 KiB
JavaScript
|
|
// -------------------------- POPUP (set position)
|
|
|
|
function ppp(mylink, windowname, width, height, x, y) {
|
|
if (! window.focus)return true;
|
|
var href;
|
|
if (typeof(mylink) == 'string') href=mylink;
|
|
else href=mylink.href;
|
|
var open = window.open(href, windowname, 'width=' + width + ',height='+ height + ',left=' + x + ',top=' + y + ', resizable=no, location=no, menubar=no');
|
|
open.focus();
|
|
// setTimeout(function(){ open.close(); }, 15000);
|
|
return false;
|
|
}
|
|
|
|
// -------------------------- POPUP RANDOM POSITION TIMEOUT
|
|
var w = window.innerWidth;
|
|
var h = window.innerHeight;
|
|
|
|
function posX(){ return Math.ceil(Math.random() * w)-200 }
|
|
function posY(){ return Math.ceil(Math.random() * h) }
|
|
|
|
function pppR(mylink, windowname, width, height) {
|
|
if (! window.focus)return true;
|
|
var href;
|
|
if (typeof(mylink) == 'string') href=mylink;
|
|
else href=mylink.href;
|
|
var open = window.open(href, windowname, 'width=' + width + ',height='+ height + ',left=' + posX() + ',top=' + posY() + ', resizable=no, location=no, menubar=no');
|
|
open.focus();
|
|
setTimeout(function(){ open.close(); }, 15000);
|
|
return false;
|
|
}
|
|
|
|
// -------------------------- POPUP RANDOM POSITION NO!TIMEOUT
|
|
|
|
function pppRNT(mylink, windowname, width, height) {
|
|
if (! window.focus)return true;
|
|
var href;
|
|
if (typeof(mylink) == 'string') href=mylink;
|
|
else href=mylink.href;
|
|
var open = window.open(href, windowname, 'width=' + width + ',height='+ height + ',left=' + posX() + ',top=' + posY() + ', resizable=no, location=no, menubar=no');
|
|
open.focus();
|
|
//setTimeout(function(){ open.close(); }, 15000);
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
// -------------------------- REDIRECT OPENER (from popup)
|
|
function next(mylink){
|
|
var mhref = mylink +'.html';
|
|
window.opener.location.href = mhref;
|
|
}
|
|
|