Jump to content

Problems with screen.width and screen.height


gevensen

Recommended Posts

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>

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.