How to make jquery event delayed?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
31 views
By clicking on the button triggers the transition to another page.

var url = "http://site.com/"; $("#add-btn").mouseup(function() { $(location).attr('href',url); });


How to delay this transition for a few seconds?
by | 31 views

2 Answers

0 like 0 dislike
Wrap the transition in setTimeout() will not go?
var url = "http://site.com/"; $("#add-btn").mouseup(function() { setTimeout(function(){ $(location).attr('href',url); }, 2000); //2 seconds });
by
0 like 0 dislike
delay()
by

Related questions

0 like 0 dislike
2 answers
asked May 21, 2019 by rabodis
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
4 answers
110,608 questions
257,186 answers
0 comments
35,593 users