Lately I was assigned to do Ads Campaign Module in one of my projects. Clients wish that the ads section needs to be displayed in a fixed position even if the web page is scrolled up and down. So one of my tasks is to calculate the browser size and define the fixed position of Ads section as browser size varies.
The following code does the job of gathering the browsers (detect browser) size:
Once, we get the correct browser size, then we can start to define CSS code to set fixed position of Ads section. However, CSS is expressing differently in HTML in different browsers. It is also a good practice to detect different browser again and set different Top and Left value of fixed position of Ads section.
Hope this helps others with similar problem.