Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
554 views
in Technique[技术] by (71.8m points)

javascript - jQuery:等待/延迟1秒而不执行代码(jQuery: Wait/Delay 1 second without executing code)

I can't get the .delay method working in jQuery:(我无法在.delay方法:)

$.delay(3000); // not working $(queue).delay(3000); // not working I'm using a while loop to wait until an uncontrolled changing value is greater than or equal to another and I can't find any way to hault execution for X seconds.(我正在使用while循环来等待一个不受控制的更改值大于或等于另一个并且我找不到任何方法来执行X秒的执行。)   ask by Brian Graham translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can also just delay some operation this way:(您也可以通过这种方式延迟某些操作:)

setTimeout(function (){ // Something you want delayed. }, 5000); // How long do you want the delay to be (in milliseconds)?

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...