跳转前暂停几秒js如何实现

jquery如何实现跳转前暂停几秒

今天有个需求,类似答题的,需要显示结果后再跳转。

此处直接通过settimeout实现。

代码如下:

url = 'www.baidu.com';

setTimeout("location.href = '" + url + "'",500);//500毫秒后跳转

就这样啦!

文章来源:刘俊涛的博客

地址:http://www.cnblogs.com/lovebing

原文地址:https://www.cnblogs.com/lovebing/p/7805199.html