/    Sign up×
Community /Pin to ProfileBookmark

resizing browser window

ok basically im trying to resize the browser to fit an image exactly. originally i thought it would be rather simple. id just use resizeto to the exact pixels of the image. However, apparently resizeto resizes the the whole browser not just the body. i compensated using simple observation, but once again realized that even though it may seem to fit on my computer, it wont neccessarily fit on others, due to different resolutions, browser display options, etc. My question is, how would i go about resizing just the body for a perfect fit around my image, and if thats not possible, how would i go about generally compensating over any computer. (I’m assuming theres ways to get the size of the toolbar, address bar, menubar, etc)

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@KorFeb 13.2004 — The problem is intricate. The width is easy (screen.availWidth will do the job). The height is not.

  • - Different browsers have different toolbars height.

  • - different users, even on same type of browser, set up in different ways their upper toolbars.


  • Thus, the correspondent screen.availHeight it is not of great help.

    You can solve your problem only if you open your page from within another page, with no tool bars. This way the screen methods will do their job.

    On the other hand...I wonder... is there a way to detect if your browser has an active scrool bar? If so, the problem could be solve...
    Copy linkTweet thisAlerts:
    @cro0kedauthorFeb 13.2004 — well the vertical scrollbar is disabled and the horizontal scrollbar is enabled by default on my page.
    ×

    Success!

    Help @cro0ked spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.14,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...