Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:09:10+00:00 2026-05-31T18:09:10+00:00

My website is optimized (with fixed width) for 1024×768 layout. I plan to add

  • 0

My website is optimized (with fixed width) for 1024×768 layout. I plan to add vertical banners on either side of the page for people having resolution width 1280 or higher.

Using screen.width, I can easily do this. But I face a problem when trying it on machines with multiple monitors.

Lets assume the below mentioned scenario:

Monitor 1 (primary display) – Resolution is 1024 x 768

Monitor 2 (secondary display) – Resolution is 1440 x 900

screen.width always shows width as 1024 irrespective of the monitor I browse the page on. The values are reversed if I change the primary monitor to Monitor 2.

This is a big problem especially for people having 1024×768 resolution as primary resolution. This means that I could potentially loose banner impressions in such scenarios.

I would really appreciate any help on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:09:11+00:00Added an answer on May 31, 2026 at 6:09 pm

    Thanks for your response duskwuff. Helped me compile the below function which solved the problem for me.

    function getBrowserWith()
    {
        if(($.browser.msie == true && $.browser.version == '9.0') || $.browser.webkit == true || $.browser.mozilla == true)
            return window.innerWidth;
        else if(($.browser.msie == true) && ($.browser.version == '7.0' || $.browser.version == '8.0'))
            return document.documentElement.clientWidth;
        else
            return screen.width;
    }
    

    Important notes

    1. jQuery 1.4+ is required
    2. Note that the above function has been tested only for IE7+, FF7+ & Chrome16+ browsers.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently building a website optimized for mobile devices. <meta name="viewport" content="width=device-width; initial-scale=1.0;
I wish to create a mobile optimized web app by loading a website from
I am coding an asian language learning module for my mojoportal-based iphone-optimized website (work
ARM website states that there are certain NEON optimized libraries and show examples of
I have a website. I'd like to create a 'mobile optimized' version. My question
Good evening, I have a website with a current css optimized for a desktop
Say I have a mobile optimized website which runs with a lot of javascript
I'm working on a website that will eventually have a version that is optimized
So I'm making a mobile-optimized website and everything looks great on iphone, android, etc.
I was recently asked to add some Woopra JavaScript to a website and noticed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.