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

  • Home
  • SEARCH
  • 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 8030599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:49:24+00:00 2026-06-05T00:49:24+00:00

Firstly, I’m by no means a web designer so I have very little idea

  • 0

Firstly, I’m by no means a web designer so I have very little idea what I’m doing.

I’m working on the HTML/Javascript for a Unity Webplayer application trying to make the Webplayer take up most (not all) of the browser’s viewable area. The <body> of the page is set to have no margins nor scroll bars like so,

<body margin="0" marginwidth="0" marginheight="0" scroll="no">

I’m getting the values for the browser’s viewable area like this,

winWidth = window.innerWidth;
winHeight = window.innerHeight;

And I call the Unity Webplayer with this,

unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", winWidth, winHeight, params);

Everything seems to work mostly properly with this setup. However, when I multiply winWidth and winHeight by non-whole numbers (i.e., 0.5 or 1.9) the height is not properly scaled in Firefox 12. Regardless of the value I put in there, it’s always the same (wrong) vertical height. In this picture, both innerHeight and innerWidth are multiplied by 0.9 and, as you can see, height is definitely wrong—and this is the wrong height I get no matter what non-whole number I multiply it by.
innerHeight * 0.9

This code works just fine in Chrome 19 and IE 9. How do I fix 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-06-05T00:49:25+00:00Added an answer on June 5, 2026 at 12:49 am

    I don’t know what the exact situation is, as I’m not familiar with the Unity JavaScript interface you are using, but I think there’s a good chance that you need to specify an integer width and height for the player, whereas your calculation is producing a non-integral number.

    Simply write Math.round(winWidth * 0.9) instead of winWidth * 0.9 to get the nearest integer result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly, I have done my research and already know that JavaScript = client JSPs
Firstly I hate IE but we all have to support it! I have a
Firstly, i have a grdData at my main page. After choosing the data i
Firstly, let me say that I know that http://sphinxsearch.com/docs/current.html#conf-sql-attr-string says strings can only be
Firstly, there have some tag links in my main page. click each one, post
Firstly, I should say I'm completely new to Pylons, trying to learn web development
Firstly, I have migrated my CVS repository into SVN repository. I checked out this
Firstly, I have found many examples of how to grab data from a db
Firstly anyone else trying to get onto forum.hibernate.org. I have been trying for a
Firstly I must emphasis that the HTML is pre-generated and cannot be altered -

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.