Home > Paid Traffic Sources > POP / PPV / Redirect

PPV Window Resize Script (5)


03-31-2011 12:53 PM #1 jleone2008 (Member)
PPV Window Resize Script

Do any of you use a resizing script for your ppv or do you just make the links open in a new window?

I've tested this script and it works great for firefox/chrome, but IE blocks the activex upon loading.

Code:
<---ADD TO HEAD--->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>


<--- ADD BEFORE CLOSING BODY TAG--->
<script type="text/javascript">
$("a").click(function() {
window.resizeTo(screen.width,screen.height-30);
})
</script>


03-31-2011 02:15 PM #2 ppvnewbie (Member)

I don't use it anymore since LI/TV always disapproved my landers...I use some more catchy audio instead ;-)


03-31-2011 06:02 PM #3 southbound (Member)

I resize pops anywhere other than TV since I don't want to lose that account. The biggest issue I had with resizing is that I didn't always want to pop a full screen because that triggers an instant close by a lot of users, but I wanted the page a bit bigger and to be able to control exactly what the user saw. Problem is, with so many toolbars and whatnot installed, it's a crapshoot because the viewing window is going to be different for a lot of users.

Soooo.... here is a sexy little piece that will let you resize to the viewport dimensions, so regardless of what crap they have taking up their toolbars, you control their viewable area and where on the screen it pops:

Code:
<script language="javascript">
function GetInnerSize () {
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return [x,y];
}

function ResizeToInner (w, h, x, y) {

	if (x==undefined) x = window.screenLeft || window.screenX;
	if (y==undefined) y = window.screenTop || window.screenY;
	window.moveTo(0,0);
	window.resizeTo(screen.availWidth,screen.availHeight);
	var inner = GetInnerSize();
	var ox = screen.availWidth-inner[0];
	var oy = screen.availHeight-inner[1];
	window.resizeTo(w+ox, h+oy);
	window.moveTo(x,y);
}

</script>
then in your body tag, just put onload="ResizeToInner([width],[height],[x-position],[y-position])"


04-01-2011 01:09 AM #4 hd2010 (Member)

most of the ppv network, don't allow you to resize windows


04-01-2011 02:13 AM #5 jleone2008 (Member)

Nice script, thanks for that.

As for networks not allowing resizing, I wasn't talking about resizing the pop window. I was talking about once the user clicks a link IN the pop window, resizing that instead of opening it in a new window.


Home > Paid Traffic Sources > POP / PPV / Redirect