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 6618765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:52:44+00:00 2026-05-25T20:52:44+00:00

I am trying to update multiple sliders simultaneously on the slide and change events

  • 0

I am trying to update multiple sliders simultaneously on the slide and change events for sliders in JQuery UI.

I have code like the following:

$(function() {
    var totalSliders = 0;
    $(".slider").each(function() {
        var value = parseInt($(this).text(), 10);
        $(this).empty().slider({
            value: value,
            range: "min",
            animate: true,
            orientation: "horizontal",
            slide: updateSliders,
            change: updateSliders
        });
        totalSliders++;
    });

    function updateSliders(event, ui) {
        var activeSlider = this;
        $(".slider").slider("value", $(activeSlider).slider("value"));
    };

    $("#update").click(function() {
        $(".slider").slider("value", 10);
        return false;
    });
});

This succeeds in turning everything with a class of slider into a slider. However, whenever I move a slider, I get the following error:

Uncaught RangeError: Maximum call stack size exceeded

I’ve also tried the following implementation of updateSliders:

function updateSliders(event, ui) {
    var activeSlider = this;
    $(".slider").not(activeSlider).slider("value", $(activeSlider).slider("value"));
};

The following implementation of updateSliders(event, ui) works fine:

function updateSliders(event, ui) {
    console.log($(this).slider("value"));
};

Question:
How can I avoid the maximum call stack size error? I want all the sliders to update simultaneously.

Edit:
I only have three elements on the page with a class of slider, if that makes a difference.

  • 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-05-25T20:52:45+00:00Added an answer on May 25, 2026 at 8:52 pm

    Try modifying that handler:

    function updateSliders(event, ui) {
        if (!event.originalEvent) return;
        var activeSlider = this;
        $(".slider").slider("value", $(activeSlider).slider("value"));
    };
    

    Now that might cause some other problems with your code, I guess, but by checking for a null “originalEvent” property you can tell when your “change” handler is being called due to a programmatic update. That will keep all the updates that you’re doing from that very function from causing a firestorm of further changes.

    Here is the jsfiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following SQL statement where i'm trying to update multiple rows matching
I'm trying to write a function to update the multiple select (the second one
I'm trying to use the AutoComplete feature of JQuery to update multiple fields on
The following code uploads multiple images no problem. However, I'm trying to get it
If multiple instances of a singleton are trying to update the same property simultaneously,
I am trying to update multiple rows on one table using MySQL. I have
This is the code giving me issue - I'm trying to update multiple records
I have a page with multiple divs in it. I like to update the
I have multiple threads trying to update a MySQL database? is executeUpdate method thread-safe
I'm trying to update multiple rows in one table in MySQL database by doing

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.