There is an issue with iOS not registering click/touch events bound to elements added after DOM loads. I found out about this problem when I had such a panel that I wanted to be entirely clickable.
Following are solutions
1) Using css style : I've found this the easy fix, simply add this to the css
3) Haven't tested this fully but since iOS fires touch events, this could work, assuming you are in a jQuery setting.
Following are solutions
1) Using css style : I've found this the easy fix, simply add this to the css
<style>
.clickable-div
{
cursor: pointer;
}
</style>
2) Using jQuery :usetoucheventfor exemple:
$('.clickable-div').on('clicktouchstart',function(){ //your code });
3) Haven't tested this fully but since iOS fires touch events, this could work, assuming you are in a jQuery setting.
$('a').on('click touchend', function(e) {
var el = $(this);
var link = el.attr('href');
window.location = link;
});
The idea is that Mobile WebKit fires a touchend event at the end of a tap so we listen for that and then redirect the browser as soon as a touchend event has been fired on a link.
No comments:
Post a Comment