gevensen Posted December 31, 2011 Share Posted December 31, 2011 I am getting inconsistent results with var SWidth=$(window).width(); var SCheight=$(window).height(); I am running firefox 9 sometimes it will read fine and then go from 1900x1200 to longer, sometimes 3487 anybody run into this? then my browser window changes and I have to close the tab and reopen it to get the correct size again <script type="text/javascript"> $(document).ready(function(){ var SWidth=$(window).width(); var SCheight=$(window).height(); $('#scw').val(SWidth); $('#sch').val(SCheight); var TWidth=SWidth*.95; $('table.ccpaymenttable').attr('width', SWidth); $('td.TDwidth').attr('width', TWidth); }); </script> Link to comment https://forums.phpfreaks.com/topic/254146-problems-with-screenwidth-and-screenheight/ Share on other sites More sharing options...
scootstah Posted January 1, 2012 Share Posted January 1, 2012 What are you trying to do with this? Link to comment https://forums.phpfreaks.com/topic/254146-problems-with-screenwidth-and-screenheight/#findComment-1303066 Share on other sites More sharing options...
gevensen Posted January 2, 2012 Author Share Posted January 2, 2012 vary the size of tables to suit a browser window crazy thing is it seems to have stopped misbehaving Link to comment https://forums.phpfreaks.com/topic/254146-problems-with-screenwidth-and-screenheight/#findComment-1303377 Share on other sites More sharing options...
scootstah Posted January 2, 2012 Share Posted January 2, 2012 Can I ask why you aren't using CSS height and width properties? Link to comment https://forums.phpfreaks.com/topic/254146-problems-with-screenwidth-and-screenheight/#findComment-1303408 Share on other sites More sharing options...
gevensen Posted January 3, 2012 Author Share Posted January 3, 2012 actually I just noticed when I am in my debug mode and I bring up a jAlert window it is causing this problem, I havent tracked the why down yet though as far as CSS i need to get a little better at it, I am using the numbers via jquery to return a dynamically generated table via ajax with the correct numbers Link to comment https://forums.phpfreaks.com/topic/254146-problems-with-screenwidth-and-screenheight/#findComment-1303770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.