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.

58 lines
2.0 KiB
JavaScript

4 years ago
// -------------------------- 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
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;
}
// -------------------------- 2 POPUP RANDOM POSITION
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 pppR2(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');
var open2 = window.open('OO1.html', 'oo1','width=500,height=500,left=' + posX() + ',top=' + posY() + ', resizable=no, location=no, menubar=no');
open.focus();
open2.focus();
// setTimeout(function(){ open.close(); }, 15000);
return false;
}
// -------------------------- REDIRECT OPENER (from popup)
function next(mylink){
var mhref = mylink.href;
window.opener.location.href = mhref;
window.close();
}