View Single Post
Old 02-07-2004, 11:39 AM  
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
One method I've used is to grab the size via hahahahahahahahahaha and store it in a cookie or post it back on the next page update. Here's an example to return page width, which I used to adjust page layouts dynamically:

PHP Code:
function findWidth() {
  if (
self.innerHeight) return self.innerWidth// all except Explorer
  
if (hahahahahahahahahahadocumentElement && hahahahahahahahahahadocumentElement.clientHeight) return hahahahahahahahahahadocumentElement.clientWidth// Exp
lorer 6 Strict Mode
  
if (hahahahahahahahahahabody) return hahahahahahahahahahabody.clientWidth// Other DOM compliant browsers
  
return 1024// "None of the above"

I'd then put that value in a cookie for php's use. You might also want to track resize events if it's important to know the size at all times.
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote