문제

I'm trying to create a message notification for a web page using jQuery. The message will slide up from the bottom and then after 10 seconds slide back down. The problem is that I would like to setup the timing through the jQuery effects system if possible, rather than using setTimeouts. Which is a rather inelegant solution?

How do you use jQuery to queue up effects to happen after certain time intervals?

도움이 되었습니까?

해결책

You can use delay function along with animation. Check this URL: http://api.jquery.com/delay/

다른 팁

You could use the delay function.

But ideally I would manage my own queue, invoking the next message when the current message closes (using the complete callback no setTimeout required)

You could always use the callback on .animate() too to queue subsequent animations http://api.jquery.com/animate/

The callback will fire whenever the animation is complete.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top