I'm currently working on building a site with a responsive design. As part of that I need to prevent the below code from executing if the user visits the website using a mobile device. How can I achieve that?
The code:
var leftHeight = $("#sidebar").height();
var rightHeight = $("#main").height();
if (leftHeight > rightHeight){ $("#main").height(leftHeight)}
else{ $("#sidebar").height(rightHeight+25)};
function equalHeight() {
    var heightArray = $("#footer>div.box").map(function () {
        return $(this).height();
    }).get();
    var maxHeight = Math.max.apply(Math, heightArray);
    $("#footer>div.box").height(maxHeight);
}
equalHeight();
 
    