问题
I have created a button in my app its working fine but the problem is when I press the button it changes color and remains active after the operation is performed. I am using jquery.mobile-1.3.1.min.css
Here is the code for the button:
<a href="index.html" class="camerabtn" data-role="button" data-icon="camerabtn" data-iconpos="top" data-inline="true" onClick="capturePhoto();"></a>
I have tried using this code to reset the active state of button its working but the problem with that is when we long press the button its active state gets stuck and it remains active.
$(document).ready(function () {
$('a').bind('click', function() {
setTimeout("$('a').removeClass('ui-btn-active')", 250);
});
});
回答1:
Please see my solution here https://stackoverflow.com/a/29906779/1736785 to this problem. Finally got it fixed! :)
来源:https://stackoverflow.com/questions/17228775/jquery-mobile-button-state-remains-active-in-phonegap-android