How to make jquery event delayed?

0 like 0 dislike
25 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 | 25 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
33,804 users