0
<script type="text/javascript">
Some javascript code here * 80%
</script>

<div style="height:80% of user's availHeight here">
My content
</div>

I know it's brief, but hope it explains what I'm looking for. Much help is greatly appreciated. Thank You! :)

  • If it is just about the dimensions: [Get the size of the screen, current web page and browser window](http://stackoverflow.com/questions/3437786) – t.niese Apr 09 '15 at 06:17

1 Answers1

1

Just to point out that screen resolution has (almost) nothing to do with a browser window available height / width.

If you're good with CSS3 you can use vh unit

<div style="height: 80vh;"> I'm 80% of user's availHeight here </div>

Now let's answer literally your question:

How to multiply screen resolution by 80% then use in code

var screenW = screen.width;  // Number of px of Physical screen width 
var screenH = screen.height; // Number of px of Physical screen height

You have your screen size values now, multiply and do whatever you need to.

Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313