i would ask about something a litle bit hard for me because im not very stronge with JS/JQ,
i create modal using bootstrap 4, & in backend i add settimeout to close the modal after X secounds,
BUT:
if the user didn't finish reading that modal, this is my main goal,
i want to stop the settimeout once the mouse inside the modal & again if the mouse out side modal, settime out again work to finish the event
my code :
$(function(){
$('#mymodal').on('show.bs.modal', function(){
var myModal = $(this);
clearTimeout(myModal.data('hideInterval'));
myModal.data('hideInterval', setTimeout(function(){
myModal.modal('hide');
}, 3000));
});
});
sorry for disturbing you, but no other better than you :)