The idea is long press happen, the Cropping function have to take place. But only ontime "taphold" called on first time we press, then it not executed.
$(document).on("pageshow", "#pageone", function () { // simply check alert("Hello"); multiply(); }); var multiply = function () { alert("I am inside function"); $("#imgCrop").on("taphold", function () { alert("Taphold working"); //check now $("#imgCrop").Jcrop({ onSelect: storeCoords }); return false; }); } function storeCoords(c) { jQuery('#X').val(c.x); jQuery('#Y').val(c.y); jQuery('#W').val(c.w); jQuery('#H').val(c.h); document.getElementById('<%=btnCrop.ClientID%>').click(); }; <div data-role="page" id="pageone"> <asp:Image ID="imgCrop" runat="server" /> </div>
The above code output is "hello" then "I am inside function" and then "Taphold working(first time)" then able crop then same "hello" then "I am inside function" , not Taphold working. So on. How to make work taphold second time?