I am currently working on a modal box that fades in when the mouse hovers over it and fades out when the mouse leaves. However, I have encountered an issue with touch screen devices like tablets where the modal does not fade out once it is displayed on the page. Is there a way to adjust this code so that whenever a user touches outside the modal box, it will fade out?
$(".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");
});