How can i trigger this jquery script to automatically run after a set amount of time (5 seconds maybe)?

user2604065

I would like this script to automatically run after 5 seconds. Just getting into jquery and did not know how to do this... Thanks!

$(document).ready(function(e) {

    $('#dropdown').on('click',function(){

        $('.dropdownwrap').slideToggle();


    });

});
A. Wolff

As i understand your question, you want to trigger click() event after 5 seconds, you could use following code:

$(document).ready(function (e) {

    $('#dropdown').on('click', function () {

        $('.dropdownwrap').slideToggle();


    }).delay(5000).queue(function () {
        this.click();
    });

});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I configure Firefox to automatically stop loading pages after set amount of time?

From Dev

Run a trigger X amount of time after an edit

From Dev

With Rails using Minitest, how can I set up RuboCop to run automatically each time tests are run with rake?

From Dev

How can I make a script run automatically after gdm login and logout?

From Dev

jQuery Mobile 1.4.x: How can I put a popup after 5 seconds the app starts

From Dev

How can I shut down the PC after specified amount of time?

From Dev

How can i change jtextfield border after 5 seconds?

From Dev

How can i change jtextfield border after 5 seconds?

From Dev

how can i do a jquery auto refresh every x amount of seconds, but only if form field is not being edited?

From Dev

How to trigger f11 effect only after 5 seconds of pressing key using javascript or jquery?

From Dev

How can I automatically run a docker container on/after image build?

From Dev

How to trigger event after i scroll a page certain amount in pixels from the top? Javascript or Jquery

From Dev

How to trigger event after i scroll a page certain amount in pixels from the top? Javascript or Jquery

From Dev

How can I automatically shutdown the system after a specific time?

From Dev

How we can trigger test cycle RUN button automatically at particular time for overnight testing using silk central?

From Dev

automatically run script on successful time sync - how?

From Dev

how to run a angular js controller continuously(in every 5 seconds) after called the first time

From Dev

How to make kivy window close automatically after specific amount of time?

From Dev

How can i hide a div on clicking it which is already automatically hiding after some seconds?

From Dev

How can i hide a div on clicking it which is already automatically hiding after some seconds?

From Dev

how do i run a script 5mn after startup?

From Dev

How do I run a function until time is multiple of 5 seconds in Perl?

From Dev

How can I set up a php script to run via cron?

From Dev

How can a PowerShell script be automatically run on startup?

From Dev

How can I run a script immediately after connecting via SSH?

From Dev

Can I run a Pentium 4 on 100% for an extended amount of time?

From Dev

How to set a interval with Puppeteer to run a certain amount of time?

From Dev

How to make a slider moves with jquery automatically every 5 seconds

From Dev

How can I set my system to suspend when inactive to a longer amount of time

Related Related

  1. 1

    How do I configure Firefox to automatically stop loading pages after set amount of time?

  2. 2

    Run a trigger X amount of time after an edit

  3. 3

    With Rails using Minitest, how can I set up RuboCop to run automatically each time tests are run with rake?

  4. 4

    How can I make a script run automatically after gdm login and logout?

  5. 5

    jQuery Mobile 1.4.x: How can I put a popup after 5 seconds the app starts

  6. 6

    How can I shut down the PC after specified amount of time?

  7. 7

    How can i change jtextfield border after 5 seconds?

  8. 8

    How can i change jtextfield border after 5 seconds?

  9. 9

    how can i do a jquery auto refresh every x amount of seconds, but only if form field is not being edited?

  10. 10

    How to trigger f11 effect only after 5 seconds of pressing key using javascript or jquery?

  11. 11

    How can I automatically run a docker container on/after image build?

  12. 12

    How to trigger event after i scroll a page certain amount in pixels from the top? Javascript or Jquery

  13. 13

    How to trigger event after i scroll a page certain amount in pixels from the top? Javascript or Jquery

  14. 14

    How can I automatically shutdown the system after a specific time?

  15. 15

    How we can trigger test cycle RUN button automatically at particular time for overnight testing using silk central?

  16. 16

    automatically run script on successful time sync - how?

  17. 17

    how to run a angular js controller continuously(in every 5 seconds) after called the first time

  18. 18

    How to make kivy window close automatically after specific amount of time?

  19. 19

    How can i hide a div on clicking it which is already automatically hiding after some seconds?

  20. 20

    How can i hide a div on clicking it which is already automatically hiding after some seconds?

  21. 21

    how do i run a script 5mn after startup?

  22. 22

    How do I run a function until time is multiple of 5 seconds in Perl?

  23. 23

    How can I set up a php script to run via cron?

  24. 24

    How can a PowerShell script be automatically run on startup?

  25. 25

    How can I run a script immediately after connecting via SSH?

  26. 26

    Can I run a Pentium 4 on 100% for an extended amount of time?

  27. 27

    How to set a interval with Puppeteer to run a certain amount of time?

  28. 28

    How to make a slider moves with jquery automatically every 5 seconds

  29. 29

    How can I set my system to suspend when inactive to a longer amount of time

HotTag

Archive