I am working on a website that is rated at 1024 X 768 as the minimum resolution. So, we have about 970 pixels. The design returned with an interesting layout with a centered website with a banner that actually exceeds this width (more precisely, 1288 pixels), which will look good for users with high resolution, but looks great at 1024.
So, to prevent the scroll bars from showing for those with 1024, I completely placed the banner and used overflow-x: hidden on the body. This works great in our target browsers.
Now the client has returned and asked for scrollbars to be present for users on 800 X 600 (yes, this is not the goal) so that they can see the critical login button.
How can this be placed for these 2% of their users without radical changes? All I can think of is to detect their screen width and remove the overflow-x: hidden.
You must love when requirements change at the end of the assembly process!
Change - that’s what it seems to me, that seems to me quite simple - any reservations here?
if (screen.width < 1024) { $("body").css("overflow-x", "visible"); }
source share