javascript - jQuery: User must stay on page for determined time to show content -
i'm having problems code. can see below, content of post shown if user click on link provided. unlock action. need user must stay on page @ least seconds before unlock content. if user leave page before determined time, content won't show. way it?
jquery(document).ready(function(){ var clicked = new set; jquery('.button').click(function() { clicked.add(this); if(clicked.size>=10) jquery('.pagelocked').hide(); if(clicked.size>=10) jquery('.content').show(); }); });
perhaps use settimeout display content after length of time.
$('.button').click(function() { settimeout(function() { $('.pagelocked').hide(); $('.content').show(); },10000); });
Comments
Post a Comment