2
I have a menu that opens based on the coordinates X
and Y
of click
, but when it was opened at the ends it ended up extrapolating the layout, I arranged it, but when the scrollbar
lateral is active it ends up extrapolating some pixels (probably in the height
also), as the window.innerWidth
does not take the difference of scroll size, example...
when scroll is not active window.innerWidth = 1420
when scroll is active window.innerWidth = 1420
That is, depending on the platform the scroll on average can have a width of up to 15/20px, need to detect when the Scrollbar is active and when active know its size to subtract this difference, it is possible?
Cool, the hard part will be how I find the size of the scroll, in fact I think I’ll have to set a style for it with css3 and leave this size fixed
– Felipe Duarte
I put the other half of the answer.
– Laércio Lopes
I was able to solve with the following scrollWidth and scrollHeight property in Document.body, it calculates the page’s innerWidht/Height by removing the scroll size if active, that’s all I needed...
– Felipe Duarte