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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:42:02+00:00 2026-06-07T00:42:02+00:00

I am working with jQuery UI slider . Here is the code i am

  • 0

I am working with jQuery UI slider.

Here is the code i am using:

$(function() {
        $( "#slider" ).slider({
            value:1,
            min: 0,
            max: 5,
            step: 1,
            slide: function( event, ui ) {
                $( "#amount" ).val( "$" + ui.value );
            }
        });
        $( "#amount" ).val( "$" + $( "#slider" ).slider( "value" ) );
    });

There will be 5 steps and I’d like to show the strings in each step instead of the numbers:

1=very sad
2=sad
3=not so sad
4=happy
5=very happy

How can I do this ?

  • 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-07T00:42:03+00:00Added an answer on June 7, 2026 at 12:42 am

    You can put your step labels in an array, then use the slider’s value as an index into that array:

    var steps = [
        "very sad",
        "sad",
        "not so sad",
        "happy",
        "very happy"
    ];
    
    $(function() {
        $("#slider").slider({
            value: 1,
            min: 0,
            max: 4,
            step: 1,
            slide: function(event, ui) {
                $("#amount").val(steps[ui.value]);
            }
        });
        $("#amount").val(steps[$("#slider").slider("value")]);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on jquery slider to take min and max price and I
I'm working on pizzli.com/darrenwp. I've created a featured content slider using Jquery/Jquery UI and
I have the following JQuery function about a range slider . It's just working
Here i am using a image slider and a cycle plugin of jquery. but
I have created jquery image slider and it is working good. However i have
I am integrating a Jquery slider inside of wordpress here is the demo of
I have a jquery slider which is working good in Firefox and Chrome. But
let's say I have a jQuery UI Slider like so: $(.mySlider).slider({ range: min, min:
I am using a price range, ie jquery range slider. And i have two
I'm trying to get a menu to slide in/out using jQuery UI and I

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.