All,
I have a DIV with a set width
I would like to create a javascript function that will change the width depending on the screen resolution. Basically I would like to change the width to 1015 if the screen resolution is 1024 x 768.
I've written this much on the asp page so far, but don't know how to apply my dstyle value,
Todd
I have a DIV with a set width
Code:
<div class="scrollTable" id="scrollUserTable" style="overflow: auto; height: 200; width: 1270;">
I would like to create a javascript function that will change the width depending on the screen resolution. Basically I would like to change the width to 1015 if the screen resolution is 1024 x 768.
I've written this much on the asp page so far, but don't know how to apply my dstyle value,
Code:
{
//Determine screen resolution
resolution = screen.width+' x '+screen.height
alert('Your resolution is: ' + resolution);
if (resolution == "1024 x 768")
{
dstyle = "overflow: auto; height: 200; width: 1015;";
}
else
{
dstyle = "overflow: auto; height: 200; width: 1270;";
}
}
Todd