I need to find the user screen width and needs to apply this width to a style.
I have a container.
<div id="container">
</div>
I need to put the width into css using JavaScript or any other options.
How can I do this??
Thanks for help in advance.
To get the screen resolution use
screenobject:To get the width of you browser window (for all browsers except IE6 and below, otherwise check this cross-browser method) use:
Also, pay attention that the script should be called only when the document is fully loaded.
DEMO: http://jsfiddle.net/DNPNz/