could someone see what i am doing wrong here? I wish for the modal to auto popup after 5 seconds of inactivity but it just dont seem to work.
here is my jq
var THRESHOLD = 5 * 1000;
var lastActive = Date.now();
$(window).ready(function() {
if (Date.now() > lastActive + THRESHOLD) {
$('#modal').fadeIn(1500).css('display','block').trigger('click');
}
lastActive = Date.now();
});