Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screen resolution

Status
Not open for further replies.

millencolin

Technical User
Jul 13, 2000
21
AR
is there any way to detect the screen resolution o to design a page that will look alright in all screen resolutions?
 
I've seen you in the Flash Forum, are you using Flash here?<br><br>Well, this is the script to get the users resolution:<br><br>&lt;script language=&quot;JavaScript&quot;&gt;<br>&lt;!--<br>function GetValues(){<br>w=window.screen.width; //RESOLUTION<br>h=window.screen.height; //&nbsp;&nbsp;&quot;<br>aw=window.screen.availWidth; //REAL SCREEN SPACE AVAILABLE<br>ah=window.screen.availHeight; //&nbsp;&nbsp;&nbsp;&quot;&quot;<br>l=window.screen.availLeft; //Coordinate of the LEFT border of the AVAILABLE AREA.<br>t=window.screen.availTop; //TOP border of AVAIL AREA.<br>colors=window.screen.Colors; //COLOR DEPTH<br>//CODE TO RESIZE OR OPEN.<br>}<br>//--&gt;<br>&lt;/script&gt;<br><br>Once you grab the info, you can resize your page to fit the screen or Open a new window with these characteristics.<br><br>To resize your page add these lines instead of CODE TO RESIZE OR OPEN:<br><br>if (window.moveTo) window.moveTo(l,t) <br>if (window.resizeTo) window.resizeTo(aw,ah)//or (w,h)if you want.<br><br>To open a new window with the dimensions of the screen:<br><br>ww = window.open('YOURPAGE.html','ww','width=750,height=550,resizable=0,alwaysRaised=1'); <br>if (window.ww && window.moveTo) ww.moveTo(l,t) //ww.moveTo((w-780)/2,(h-580)/2);<br>if (window.ww && window.resizeTo && (w&lt;810)) ww.resizeTo(w,h)<br><br>I hope that helped.<br><br><br><br><br><br> <p>Fernando Regueiro<br><a href=mailto:ferhelping@yahoo.com>ferhelping@yahoo.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top