Jump to content

jQuery ui slider handles


OAFC_Rob

Recommended Posts

I am trying to get the jQuery ui slider handles if dragged to meet, to keep a minimum distance apart of say 50, so it would look like 50 - 100 on a rnage from 0 to 200. I have done this with no problems really, but my next bit is a bit harder and I can't seem to find anything on the web that is helpful.

 

What I want to happen, if a user clicks and drags the first ui handle, the second will increment as well keeping that gap of 50 unless the range max value is met.

 

Here is the code I've got;

 

$("#priceRange").slider({
                            range: true,
                            min: 50,
                            max: 1000,
                            values: [50, 500],
                            step: 50,
                            slide: function(event, ui){
                                
                                priceMin = ui.values[0];
                                priceMax = ui.values[1];

                                if((priceMax-priceMin)<50){
                                    return false; 
                                }
});

 

And here is an exmaple I saw on a website, which makes me believe it is possible. http://www.allsaints.com/men/new/?WT.ac=ss12mens/

 

Please help me before I go insane!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.