Is there any way to find the window dimension in browser in 8.1.5, I know this is in 8.1.6 but cannot use that version yet?
what do you need it for?
I am altering what percentage of a view is shown changing based on mouse position and clicks. These mouse position events in the change scripts are given in flat pixels and I want to make them percentages basically
hmm
i guess you could add in a “ghost” container which has height/width set to 100vh/100vw
(dont think you can use these inside a script so you will have to do a binding in between i guess)
vw | Relative to 1% of the width of the viewport* |
---|---|
vh | Relative to 1% of the height of the viewport* |
and then read those poisition props/ and use them in your % calculations
just be sure to set the “ghost” container invisible with overflow hidden
When I do that I am getting dimensions of 7.44 and 3.5 which seems very odd
Those may be correct scalars, just with funky units (like ems
or rems
). Just a thought…
did you use 100?
ah i see, you cant use this if the root container is in percent, how odd,
so you will have to wrap that container in one aswell and set it to fixed first. (also overflow hidden)
ah but that doesnt seem to work either, it reads it out as 100vh then. how unfortunate it doesnt get the real values