Do something after n seconds after moving slider

I want to process value of slider with delay. So If I move with slider to X position, I want to make jquery function to do something BUT, after n seconds. If I do something between these 4 seconds again - start timer from begining. $('#slider1').slider({ min: 0, max: diff, range: true, values: [diff-2 , diff], slide: function(event, ui) { }, change: function(event, ui) { // n SECONDS after changing slider's value do something... }); I found: > $.throttle(); but It doesn't work, or I don't know how to use it. Tried to add to the function succes, like this, but with no luck: change: function(event, ui) { $.throttle( 4000, console.log('this should show after 4 seconds...') ); });
Did you already include the plugin?

以上就是Do something after n seconds after moving slider的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准