How to reset a jQuery UI slider?

后端 未结 5 1832
梦毁少年i
梦毁少年i 2021-02-07 05:50
    
    
    

        
5条回答
  •  北恋
    北恋 (楼主)
    2021-02-07 06:14

    Not storing your original options / multiple slider reset

    If you don't want to store your original value or you have multiple sliders try this:

    // Reset the sliders to their original min/max values
    $('.slider').each(function(){
    
      var options = $(this).slider( 'option' );
    
      $(this).slider( 'values', [ options.min, options.max ] );
    
    });
    

    In relation to your code see this demo.

提交回复
热议问题