APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Size of the simulation post and replies

Return to the Size of the simulation thread
Login to post to this thread

Size of the simulation in many different screen
Léo Santos
10 Posts

Hello everyone, how can I put variable sizes for the screen of my simulation depending on the user's screen? I put "1350.671" and is good for my screen, but for other resolutions is strange. I have to use some variable or need to put lower resolution?


Léo Rodrigues Macena dos Santos Departament of Physics - Faculdade de Ciências da Universidade do Porto.

Replies to Size of the simulation in many different screen

Re: Size of the simulation in many different screen -
Francisco Esquembre
228 Posts

Hi Léo,

I understand you refer to a JavaScript simulation...

You can use some properties of the window object. See, for instance,  http://www.w3schools.com/jsref/prop_win_innerheight.asp

Paco



Re: Re: Size of the simulation in many different screen -
Léo Santos
10 Posts

Hi Francisco. Thank you for the quick reply. I has tested this method in some PCs and browsers and it worked perfectly. Thank you very much. :)


Léo Rodrigues Macena dos Santos Departament of Physics - Faculdade de Ciências da Universidade do Porto.


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book