all-BI Business Intelligence Solutions: Munich (München, Germany and New York City USA
inSight / dynaSight consulting
search all-BI.com

back to all-BI Business Intelligence Solutions home pageall-BI Business Intelligence Solutions strategic services in Munich (München) Germany and New York City , USAColdFusion, Crytsal Reports, DB2, dynaSight, JavaScript, OLAP, Oracle, SQL ServColdFusion, Crytsal Reports, DB2, dynaSight, JavaScript, OLAP, Oracle, SQL Server and  much more!all-BI Business Intelligence Solutions in Munich (München) and New Yorkdeutsche Version der Hompage
Oracle, dynaSight (arcplan), JavaScript, Crystal Reports, ColdFusion and more
arcplan dynaSight
arcplan dynaSight knowledge
JavaScript
JavaScript knowledge and  tips
take a small break...
Auch deutsch ist unsere Muttersprache!

Notre langue maternelle est aussi le français!

Nuestra lengua maternal es tambien el español!

Business Intelligence Industry News:

Mar. 01, '08
SAP BW and Microsoft Analysis Services (OLAP) with one front-end: Panorama NovaView.
(Panorama)


 
JavaScript

javascript

Adjusting web pages to a given screen resolution

You might be familiar with the following scenario: a given page in your application looks very good at a resolution of 800 x 600 pixels but looks awkward at a resolution of 1280 x 1024 pixels. Or, possibly the other way around: your layout looks great at a resolution of 1024 x 768 pixels but completely cramped with a resolution of 800 x 600 pixels.

If your design is such that you can no longer accomodate different resolutions with the same page, you are left with only one choice, and that is to offer the same content with several pages that are optimized for different screen resolutions. The easiest way to do so is to use JavaScript to query the user's screen resolutions and to serve the appropriate web page for the given configuration.

You need to insert the following script at the very top of the <body> tag:

<script language = "Javascript">
if (screen.width >= 1280)
window.location.ref = "index1280.html"
else if (screen.width >= 1024)
windows.location.ref = "index1024.html"
else
windows.location.ref = "indexstd.html";
</script>

If the width of the screen (screen.width) is larger than 1280 pixels, then the browser will load the file index1280.html. Should the screen width be greater than or equal to 1024 pixels (but less than 1280) then the user gets to see the file index1024.html. For smaller resolutions the script will tell the browser to open the standard page called indexstd.html.

For the very rare case that the user has JavaScript deactivated you need to make sure that after the script above, you include one of the following: i) either an information for the users informing them to turn on JavaScript or ii) the HTML code for a very simple version of your page.

previous tip | next tip

 
© 2003 - 2006 all-BI GmbH, Business Intelligence Solutions