pastebin

About this pastebin

Welcome to the bulix.org / pastebin. Please don't use this pastebin for illegal purposes, defamation or kitten-squashing.

This pastebin is written using PHP and MySQL and relies on Alex Gorbatchev's syntax hhighlighter (JavaScript based). To avoid spam, you will be required to complete a small mathematical challenge when adding a new paste.

Paste #11839: difference between pageWidth,pageHeight,windowWidth,windowHeight

//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

New paste

  Language:
Private   — Wrap long lines  —  4 + 1 =   —  

30 more recent public pastes


# Title Type Date
1 Untitled XML/HTML paste by 71.235.178.72 XML/HTML 04 Jul 2009, 03:13
2 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 17:40
3 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 15:09
4 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 15:08
5 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 14:19
6 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 14:13
7 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 02:35
8 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 02:22
9 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 02:20
10 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 02:17
11 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 00:40
12 Untitled ASCII paste by 67.141.131.214 ASCII 03 Jul 2009, 00:23
13 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 23:20
14 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 23:19
15 Untitled Perl paste by 212.117.187.46 Perl 02 Jul 2009, 21:27
16 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 20:42
17 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 19:12
18 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 19:10
19 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 19:08
20 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 19:01
21 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 18:51
22 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 11:19
23 Untitled ASCII paste by 82.247.183.72 ASCII 02 Jul 2009, 11:16
24 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 11:12
25 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 11:01
26 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 10:56
27 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 10:54
28 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 10:36
29 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 03:23
30 Untitled ASCII paste by 67.141.131.214 ASCII 02 Jul 2009, 03:21

Powered by the Bulix.org Code Pastebin, by Maxime Petazzoni. View pastebin statistics.