I have a modal box which fades in on mouseenter
and fades out on mouseleave
. The only problem is when using a touch screen device such as a tablet, I can't get the modal to fadeout
once it's showing on the page. Is there any way of modifying this code to where anytime the user touches outside the modal box it will fadeout
?
$(".tiptrigger").mouseenter(function() {
var s_id = $(this).attr('id'); // There may be more than one per page
$("#tiptip_holder-"+s_id).fadeIn("fast");
});
$(".tiptrigger").mouseleave(function() {
var s_id = $(this).attr('id');
$("#tiptip_holder-"+s_id).fadeOut("slow");
});