ghusse / jQRangeSlider

A jquery UI range selection slider that supports dates
http://ghusse.github.com/jQRangeSlider/
GNU General Public License v3.0
671 stars 147 forks source link

Slide instead of move #42

Closed KyleMulder closed 11 years ago

KyleMulder commented 11 years ago

Im busy working on a project where i am using the Date range slider.

Got requested if its a possibility to make the bar slide when clicking on arrows instead of just adjusting it solidly?

ghusse commented 11 years ago

Can I have an example of before/after values? I don't understand exactly what you want to do.

Thanks

KyleMulder commented 11 years ago

Well, what I'm trying to accomplish here, is instead of adjusting the left position (if clicked on the right arrow) to make it have an slide effect, instead of just solidly adjusting it.

So in jquery sense:

$('slider').animate({left: +='13px'});

instead of

$('slider').css({left: +='13px'});

Hope this makes sense :)

ghusse commented 11 years ago

Ok, I understand. One solution is CSS based (not working on IE): http://jsfiddle.net/ghusse/bxaJh/

KyleMulder commented 11 years ago

Any way to unbind the already click events from the arrows and override with that?

ghusse commented 11 years ago

Ok, it's possible but you'll have to create a new widget inheriting from dateRangeSlider, and overwrite default behavior of both _scrollRightClick and _scrollLeftClick functions.

You can take a look at my code for leads: dateRangeSlider is itself iniheriting from rangeSlider, overwriting methods.

Examples: Inheritance declaration: https://github.com/ghusse/jQRangeSlider/blob/master/jQDateRangeSlider.js#L13 Overwritten method, calling base function: https://github.com/ghusse/jQRangeSlider/blob/master/jQDateRangeSlider.js#L30

KyleMulder commented 11 years ago

Implemented it like i would, however i am getting wierd behaviour on the sliding, check out: http://jsfiddle.net/bxaJh/9/

Its very edgy, the slider and labels aren't in parallel.

In chrome, its very smooth, firefox not so much.

ghusse commented 11 years ago

I think you should follow my advice and create a new widget inheriting from dateRangeSlider