I have the following jquery call on my website and I would only like it to be actioned if the visitor is using a desktop device (screen size over 767px). How can this be achieved?
SCRIPT
<script>$("#sidebar").stick_in_parent();</script>
I have the following jquery call on my website and I would only like it to be actioned if the visitor is using a desktop device (screen size over 767px). How can this be achieved?
SCRIPT
<script>$("#sidebar").stick_in_parent();</script>
You can check the window width, but keep in mind, there are handhelds with over 767px width. So this is not a "desktop check".
if( $(window).width() >= 767 )
$("#sidebar").stick_in_parent();
Use navigator.platform to get OS Name vs. using screen size.
What is the list of possible values for navigator.platform as of today?