I have a rotator that contains text and buttons. The buttons (anchor tags) do not work for mobile devices. I have read similar posts, and the solutions to their questions did not work for me. I made sure my html was valid, and without errors. I also inserted the following jQuery, but was unsuccessful. There is a hover effect on the button, and when tapped on a mobile device the hover effect occurs. I'm assuming there is some kind of conflict between the hover and click, but I'm not sure how to 'override' the hover??
$(function () {
$('a').on('click touchend', function() {
var link = $(this).attr('href');
window.open(link,'_blank'); // opens in new window as requested
return false; // prevent anchor click
});
});
This script is working correctly, but still does not work for mobile devices on my page.
PS I am not using jQuery Mobile, and would like to avoid using it if possible.