0
Good afternoon,
I’m making a responsive site where I use CSS with media="screen" and jQuery.
Problem:
However Javascript and CSS do not recognize the same document width value when the page has some scrollbar (when testing in Chrome using Adaptive Design Mode - Ctrl+Shift+M - works normally) that is, works perfectly on mobile devices and other devices not, because they have the scrollbar.
Example:
If you run a alert ($(window).width());
to display the width of a document with scroll bar on a desktop with 1920/1080 resolution, will bring the following response 1903
instead of 1920
Doubt:
Is there any way to take the width of a website window with scroll or make both Javascript and CSS recognize the width of the document as being the same on the desktop?
See the example http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes/
– KingRider
@Kingrider the example you indicated was also very useful, it was in it that I found 'window.innerWidth' that served what I needed. vlw.
– Wesley