Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8930343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:52:25+00:00 2026-06-15T08:52:25+00:00

Using the second answer to this question I wrote a code for a 4

  • 0

Using the second answer to this question I wrote a code for a 4 handle jquery slider. It was working fine but then I had to make multiple sliders in the same page, so I tried to module my code a bit, separating the slide function. Now the handlers in a slider overlap completely ignoring the condition I set for that case.

Here is the code for my slide function and how I call it in the slider settings:

Slide function:

function slidegen(event,ui,index){

    //Code for handler 0
    if(ui.handle == $("#weightage_slider_"+index+"_0").get(0)){
        if(ui.values[0] >= ui.values[1]){

            /*FOR SOME REASON THE NEXT LINE HAS NO EFFECT*/

            $("#weightage_slider_"+index).slider('values', 0, ui.values[1]); 
            return false;
        } else {
            // handle-0 will move
            // update display of colored handle ranges
            $("#weightage_slider_a_"+index).css('left', '0%');
            $("#weightage_slider_a_"+index).css('width', (to100(ui.values[0])+'%'));
            $("#weightage_slider_b_"+index).css('left', (to100(ui.values[0])+'%'));
            $("#weightage_slider_b_"+index).css('width', ((to100(ui.values[1])-to100(ui.values[0]))+'%'));
        }
    }

    /*SIMILAR CODE FOR THE REST OF THE HANDLERS HERE*/
}

Slider settings:

$("#weightage_slider_0").slider({ 
    min: 1,
    max: 5,
    step: 0.01,
    values: handlers, // set four handles
    slide: function(event, ui) {
        slidegen(event,ui,0);
    }, 
    change: function(event, ui) {    
        changen(event,ui,0);
    }
});

I understand that during a slide, the following sequence occurs: (i) change ui.value (ii) call slider function (iii) move the slider handle. Could it be that the bug happens because I’m making another call inside the slider function, therefore I’m altering that sequence?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:52:26+00:00Added an answer on June 15, 2026 at 8:52 am

    Problem solved! It seems you can’t module the functions you are going to use as settings. I assume it has to be with scope issues. Instead I module the whole slider creation as you can see below or in this link

    function makeslider(index,h) {
            $("#weightage_slider_" + index).slider({
                min: 1,
                max: 5,
                step: 0.01,
                values: h,
                // set four handles
                slide: function(event, ui) {
                    /*Generic slide function code here*/
                },
                change: function(event, ui) {
                    /*Generic change function code here*/
                }, 
                create: function(event, ui) {
                    /*Generic create function code here*/
                }    
            });
    }
    
    makeslider(0, handlers);
    makeslider(1, handlers1);
    makeslider(2, handlers2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

refering to this answer , the second code block. My question is: If I
I know I can answer this question easily for myself by generatin the code
I have found a lot of answer on this question, but they are all
There is probably a simple answer to this question but I just can't seem
Using the second query I can find the JOB id. But using the first
I want to pass data from second tab to first tab using delegates.But delegate
When using a computational expression, the first definition works but the second does not
The question is this: Create a page with a number of links. Then write
I know this question has been asked before, but no one has given any
Before fully defining my question, I must say that >> this question/answer << doesn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.