Coding solution: How to redraw JQuery Slider?

Coding solution: How to redraw JQuery Slider?

In this example we are going to fine-tune wonderful JQuery Slider Plugin written by Egor Khmelev.

This is the official page of the Slider:
http://blog.egorkhmelev.com/

Everything is great about this Slider except that it doesn’t allow you to refresh it settings live without reloading the page. For example it would be very useful to be able to change the slider scale, dimension / currency and/or other settings. And it is must have if you building Jquery Price Slider and need to change scale depending on user input.

Here is the solution from Plumrocket developers:

$("#Slider1").slider("redraw", { from: 0, to: 1000, scale: [0, '|', 500, '|', '1000+']});

Add this javascript code in FILE /javascripts/jquery.slider.js LINE: 420

 case "redraw":
 self.domNode.remove();
 if(isDefAndNotNull(args[1])){
 $.extend(true,self.settings,args[1]);
 self.settings.interval = self.settings.to - self.settings.from;
 self.settings.value = self.inputNode.attr("value");
 self.is = {
 init: false
 };
 self.o = {};
 }
 self.create();
 break;

Hopefully this little fix will make someone’s day better.
Enjoy!

Share:

  • chetaru

    Hi….

    Thanks for sharing this information and resources its really
    help full for me with the  help of this
    we can improve our designs and development I really inspire with this
    information thanks

  • http://www.mananpatel.in/ Manan

    Hello

    Is it possible with on onstatechange? I don’t want to redraw on click event.