Title: How to implement delay on loading
Last modified: October 12, 2019

---

# How to implement delay on loading

 *  [clairedelacroix](https://wordpress.org/support/users/clairedelacroix/)
 * (@clairedelacroix)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/how-to-implement-delay-on-loading/)
 * Hi there,
 * I’m using your plugin multisite with caching and the JS version fits my needs
   very well.
    Now basically a visitor lands on age age but I’d like some sort of
   delay before the disclaimer appears. Will it be possible to implement in future
   releases or with custom script?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [Phil](https://wordpress.org/support/users/philsbury/)
 * (@philsbury)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/how-to-implement-delay-on-loading/#post-12024749)
 * Hi [@clairedelacroix](https://wordpress.org/support/users/clairedelacroix/),
 * You can do that now with a bit of custom JS.
 * Here’s a very quick example – could tweak the functions, to do some transitions,
   but you get the idea;
 *     ```
       jQuery(function () {
         jQuery(document).on('agegateshown', function () {
           // quick test to see if we should show AG
           var shouldShow = jQuery('body').hasClass('age-restriction');
   
           // Hide AG and remove it's body class
           jQuery('.age-gate-wrapper').hide();
           jQuery('body').removeClass('age-restriction');
   
           // if we want to show
           if (shouldShow) {
             setTimeout(function(){
               // Reshow stuff
               jQuery('.age-gate-wrapper').show();
               jQuery('body').addClass('age-restriction');
             }, 5000); // show after 5 seconds
           }
         });
       });
       ```
   
 * Thanks
    Phil

Viewing 1 replies (of 1 total)

The topic ‘How to implement delay on loading’ is closed to new replies.

 * ![](https://ps.w.org/age-gate/assets/icon-256x256.png?rev=2783003)
 * [Age Gate](https://wordpress.org/plugins/age-gate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/age-gate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/age-gate/)
 * [Active Topics](https://wordpress.org/support/plugin/age-gate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/age-gate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/age-gate/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Phil](https://wordpress.org/support/users/philsbury/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/how-to-implement-delay-on-loading/#post-12024749)
 * Status: not resolved