I have a very simple mouseenter on tab to fadeIn child div thing going on, but I want touch devices to be able to tap on a close link to fadeOut the child. That's working smoothly.
When the iOS user taps again on the tab to fadeIn its child, it fades in and then immediately out. Try the third time, and it doesn't even fadeIn.
How do I get every tap of the tab to fadeIn like it was the first time?
The jQuery
$('#form').on({
mouseenter: function () {
clearTimeout( $(this).data('timeoutId') );
$(this).children('div').fadeIn(300);
$('#oops').fadeIn(80);
},
mouseleave: function() {
var self = this;
var timeoutId = setTimeout( function() {
$(self).children('div').fadeOut(700);
$('#oops').fadeOut(300);
}, 700);
$(self).data('timeoutId', timeoutId);
}
});
$('#closer').click(function(){
$('.hiding').fadeOut(700);
$('#oops').fadeOut(400);
});
Here's the fiddle: http://jsfiddle.net/natejones/mnWb6/