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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:23:54+00:00 2026-05-25T01:23:54+00:00

I am making some sliders with jquery-ui and i have a question how i

  • 0

I am making some sliders with jquery-ui and i have a question how i can do the follow:

I have this html code:

<div class="slider range-slide">
    <b>A range slider:</b>
    <span class="amount"></span>
    <div class="slide"></div> 
</div> 

And this is the js:

$(".range-slide").each(function () {
    var $this = $(this);
    $(".slide", $this).slider({
        values: [30, 60],
        min: 0,
        max: 100,
        range: true,
        slide: function (event, ui) {
            $("span.amount", $this).html("" + ui.values[0] + 
                                         " - " + ui.values[1]);
        }
    });
    $(".range-slide span.amount").html("" + $(".slide").slider("values", 0) + 
                                       " - " + $(".slide").slider("values", 1));
});   

Everyting is working fine but how can i do someting like this:

<div class="slider range-slide">
    <b>A range slider:</b>
    <span class="amount"></span>
    <div class="slide" value="30,60" max="100" min="10"></div> 
</div> 
  • 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-25T01:23:56+00:00Added an answer on May 25, 2026 at 1:23 am

    Change your slider to use those values.

    $(".slide", $this).slider({
        values: [30, 60],
        min: $(this).attr('min'),
        max: $(this).attr('max'),
        range: true,
        slide: function(event, ui) {
            $("span.amount", $this).html("" + ui.values[0] + " - " + ui.values[1]);
        }
    });
    

    UPDATED:
    Check out this fiddle

    $(".range-slide div.slide").each(function() {
    $(this).slider({
        values: [30, 60],
        min: parseInt($(this).attr('min')),
        max:  parseInt($(this).attr('max')),
        range: true,
        slide: function(event, ui) {
            $("span.amount", $(this).parent()).html("" + ui.values[0] + " - " + ui.values[1]);
        }
    });
    $(".range-slide span.amount").html("" + $(this).slider("values", 0) + " - " + $(this).slider("values", 1));
    });
    

    UPDATE 2
    Use split to separate the values by commas and assign them to variables. Fiddle

    $(".range-slide div.slide").each(function() {
        values = $(this).attr('value').split(',');
       firstVal = values[0];
        secondVal = values[1];
    
    
        $(this).slider({
            values: [firstVal , secondVal],
            min: parseInt($(this).attr('min')),
            max:  parseInt($(this).attr('max')),
            range: true,
            slide: function(event, ui) {
                $("span.amount", $(this).parent()).html("" + ui.values[0] + " - " + ui.values[1]);
            }
        });
        $(".range-slide span.amount").html("" + $(this).slider("values", 0) + " - " + $(this).slider("values", 1));
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Been having a problem making a jQuery slider, I have a list of links
While making some final tests of a class-library that I'm writing for Windows Mobile
Okay, I'm trying to be clear on this one... I have some insliding boxes,
I'm making some kind of movie with a webpage. For that I have to
I'm making a slider and I got some problem with my thumbnail, they animate
Im making some of my ajax visible for google. To do that, I have
After making some changes to a method, I find it utterly annoying to have
After making some research, I now know that I can launch an iphone app
I'm making some pretty string-manipulation-intensive code in C#.NET and got curious about some Joel
I'm making some kind of UI layers with HTML5 canvas. All layers can be

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.