On my current site (www.webuyfitprojects.com) I am implementing a bootstrap modal ('launch demo modal' button is near the bottom).
I added this code to remove the html margin shifting issue when the modal is opened. (there are multiple threads about it on here):
<script>
$('#myModal').bind('hidden.bs.modal', function () {
$("html").css("margin-right", "0px");
});
$('#myModal').bind('show.bs.modal', function () {
$("html").css("margin-right", "-15px");
});
</script>
This works on a desktop great - but on my G-Note4 and ipad mini, when I open the modal, the -15px margin-right is applied and the contents of the html expands to the right. Does anyone have a snippet I can add to tell the above code to only work on desktop? And on smaller devices change the margin-right to 0px; so it stops the html expanding?