Touch and Click in jQuery (without jQuery Mobile)

Problem One of the most common things I do with JQuery is to attach click event listeners to buttons, links and other elements as follows: $(".class").click(function(evt) {}); Unfortunately, I found that, while this approach works well for Desktop browsers, the user interaction on touch-enabled devices feels very awkward and sluggish. Solution Since this problem is … Continue reading Touch and Click in jQuery (without jQuery Mobile)

Using JQuery to Detect If on a Mobile Phone

JQuery and/or JavaScript have no native mechanism to determine whether a page is loaded on a mobile phone or not. However, CSS media queries offer this capability. I found the following nice trick on stackoverflow to utilize media queries to help JS/JQuery applications to determine whether they run in a mobile. First, insert an arbitrary … Continue reading Using JQuery to Detect If on a Mobile Phone