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>

Link to comment
Share on other sites

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