Jump to content

How to simply retrieve the window height before generating page?


Drew_Tronvig

Recommended Posts

I have only the haziest understanding of AJAX, but at this point I just want to check the height of the browser window and get that into a PHP variable before I generate the actual page. Is there an example of that sort of thing posted somewhere? I'm working in Joomla, so jQuery is loaded.

 

Thanks,

Drew

Link to comment
Share on other sites

if your using jquery 
 

$(window).height();   // returns height of browser viewport
$(document).height(); // returns height of HTML document
$(window).width();   // returns width of browser viewport
$(document).width(); // returns width of HTML document
Link to comment
Share on other sites

Well sure, and having a quick example performing a very simple comparable action would help get me up to speed in a hurry. Could you point me toward a minimal document that would do something like retrieving a screen dimension before generating the actual page? Or I could Google for hours in hopes of finding something like that.

Edited by Drew_Tronvig
Link to comment
Share on other sites

Yeah, I gave up trying to Google up an answer and asked the question at stackoverflow. I got a promising answer, and now I'm just trying to stitch together the parts from that answer into an actual working example.

 

I certainly appreciate the help here, but I was already pretty clear on how to get the values in via jquery. The trick is how to get those values back to the PHP script on the server, hence asking on the AJAX board.

 

Thanks,

Drew

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.