I’m having a problem with custom buttons in jquery mobile.
<li><a href="about.php">Button</a></li>
I want to change the background of the list element when the link button is pressed and then change it back when released.
I have tried various bits and pieces but i get theses issues:
-
using vmouseup and vmousedown to change css works but when i am scrolling over them with my finger they register the event even though i have not clicked the link
-
using tap stops the issue when scrolling over but it only changes the css for the down state, then the next page loads, when i go back to the first page the down state style is stile active
I hope this makes sense, the docs are just a blur to me now.
-
Basically i need to style an anchor when i touch it, then reverse the style when i stop touching it.
-
This needs to happen before the next page loads.
-
When my finger is scrolling the screen and slides over the anchor i don not want it to register as a touch and change the style
It seems like it should be easy but i don’t whats going on anyway.
Any help would be greatly appreciated.
Thank You
UPDATE:
hey finally got a combination working, not sure if i tried this last night and was just too tired to register or weather i was just to tired to miss it but i got it working using click to change style then tap to change back.
$(function() {
$('.profile-list li a').on( 'click', function () {
// change .css()
});
$('.profile-list li a').on( 'tap', function (){
// change back
});
});
1 Answer