abpetkov / powerange

iOS 7 style range slider
http://abpetkov.github.io/powerange/
423 stars 85 forks source link

How to redraw slider on resize windows? #5

Open exdeniz opened 10 years ago

exdeniz commented 10 years ago

Resize 100% div and this - http://i.imgur.com/3SBKe6y.png

Insider77 commented 8 years ago

I solved it this way:

add this to powerange.js

Powerange.prototype.responsive = function() { if (this.options.step) this.step(this.slider.offsetWidth, this.handle.offsetWidth); this.setStart(this.element.value); };

and this to your script

$(window).resize(function() { your_slider_reference.responsive(); }