Heres the problem, I have an if{} that currently works out if the embed size is over 900 then show the maximum width, but the maximum it cant be over is in pixels, but the maximum embed size is in % So i need to know how you can find out how big the current browser is, so how many pixels 100% would be, For example 100% width = How many pixels 100% hieght = How many pixels? Thanks
I am guessing you want to know the document width and height (essentially, the width and height of the display area). You can do this in JavaScript: XDocument = {}; //============================================================================= XDocument.GetWidth = function() { var Width = 0; if(typeof(window.innerWidth) == 'number') { //Non-IE Width = window.innerWidth; }else if(document.documentElement && document.documentElement.clientWidth) { //IE 6+ in 'standards compliant mode' Width = document.documentElement.clientWidth; }else if(document.body && document.body.clientWidth) { //IE 4 compatible Width = document.body.clientWidth; } return Width; } //----------------------------------------------------------------------------- XDocument.GetHeight = function() { var Height = 0; if(typeof(window.innerWidth) == 'number') { //Non-IE Height = window.innerHeight; }else if( document.documentElement && document.documentElement.clientHeight) { //IE 6+ in 'standards compliant mode' Height = document.documentElement.clientHeight; }else if( document.body && document.body.clientHeight) { //IE 4 compatible Height = document.body.clientHeight; } return Height; } Code (markup): You cannot do this in PHP, as PHP has no idea how the browser will render anything.
If you really want to use the information in your PHP, this may be one way of coding it, though perhaps not a search engine (or indeed user!) friendly solution: If the requested URL does not contain argument values for "width" and "height": - Serve a brief page containing JavaScript that will: -- Sense the browser proportions and save them to variables; -- Redirect to itself, appending these variables to the URL. If the requested URL does contain argument values for "width" and "height": - Use "GET" to retrieve these browser details, and serve the real page.