Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI Range slider bug?

I have run into an interesting issue with the jQuery UI slider. I need to assign its min and max values from sript and am doing the following

$("#sliCSSHt").slider('values',[minh,maxh]);
$("#sliCSSHt").slider('refresh');

The problem arises when minh = maxh. The MIN button appears to go and sit on TOP of the max button. The innocent user who then tries to inrease the max value finds that the slider has beome unresponsive since he/she is actually dragging the min button beyond the current position of the max button. What if anything can be done to get round this?

I am using jQuery UI 1.91 with jQuery 1.82 - I don't have the option of moving up to jQuery 1.9 since I am using plugins that use the browser object which has now been taken out of jQuery.

like image 323
DroidOS Avatar asked Mar 16 '26 23:03

DroidOS


1 Answers

You could always stop the sliders from overlapping. Something like

$( "#sliCSSHt" ).on( "slide", function( event, ui ) {
    if(ui.values[0]+10 > ui.values[1])  
       return false;
} );

http://jsfiddle.net/c934g/5/

Update This bug is fixed in the latest jquery-ui

using the latest jquery-ui files http://code.jquery.com/ui/1.10.3/jquery-ui.js it works.

http://jsfiddle.net/c934g/7/

like image 134
Trevor Avatar answered Mar 20 '26 23:03

Trevor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!