Last post Sep 25, 2017 08:14 AM by PatriceSc
Sep 25, 2017 03:20 AM|RedRailgun|LINK
I have a scrollable content in my website, and I just want to show the scrollbar when no touchscreen is detected, otherwise, if it's a touchscreen, then no scrollbars will show up.
Sep 25, 2017 08:12 AM|Eric Du|LINK
According to your description and needs, please check the following code to detect the touchscreen device:
if ("ontouchstart" in document.documentElement)
document.write("your device is a touch screen device.");
document.write("your device is NOT a touch device");
I think you could use different CSS @Media for different width devices:
How to Make Your Website Respond to Different Mobile Devices:
Sep 25, 2017 08:14 AM|PatriceSc|LINK
https://stackoverflow.com/questions/8764020/how-can-i-check-for-real-touch-support-on-a-browser for possible options. As noted make sure it is not counterproductive? It could have a touchscreen but the user to prefer a mouse. Maybe try if the
https://drafts.csswg.org/mediaqueries-4/#pointer gives the best pointer in which case you might be able to see it is only a touchscreen ?