# Reversing the Slider Labels to be Displayed from Maximum to Minimum

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Telerik UI for ASP.NET MVC Slider</td>
 </tr>
 <tr>
  <td>Product Version</td>
  <td>2024.4.1112</td>
 </tr>
</table>

## Description

By design, the Slider values are positioned from the minimum value to the maximum value (left to right).
How can I reverse the minimum and maximum values of the Slider so the maximum value is displayed on the left and the minimum on the right?

## Solution

1. Set the `Min()` option to **-10** and the `Max()` value to **-1**.
2. Set the initial value to **-10**.
3. Update the default Tooltip template to show the absolute value (for example, **10** instead of **-10**).
4. Update the Slider labels to show the absolute values when the page with the Slider is loaded.

```Razor HtmlHelper
    @(Html.Kendo().Slider()
        .Name("reversedSlider")
        .Min(-10)
        .Max(-1)
        .LargeStep(1)
        .Value(-10)
        .Tooltip(x => x.Template("#= Math.abs(value)#"))
    )
```

```JS scripts
    <script>
        $(document).ready(function(){
            var list = $('.k-slider ul.k-slider-items');
            var listItems = list.children('li'); // Select the Slider label element.
            $.each(listItems, function(){ // Loop through them.
                let title = parseInt($(this).attr("title")); // Get the respective value.
                let updatedTitle = Math.abs(title); // Get its absolute value.
                $(this).attr("title", updatedTitle); // Update the "title" attribute.
                $(this).find(".k-label").text(updatedTitle); // Update the label text.
            });
        });
    </script>
```

When you need to get the Slider's value, use its absolute value:

```JS scripts
    <script>
        var slider = $("#reversedSlider").data("kendoSlider");
        var sliderValue = Math.abs(slider.value());
    </script>
```

For a runnable example based on the code above, refer to the [REPL example on displaying the Slider scale from maximum to minimum](https://netcorerepl.telerik.com/mePcYfPK06mnizlY50).

## More ASP.NET MVC Slider Resources

* [ASP.NET MVC Slider Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/slider/overview)

* [ASP.NET MVC Slider Demos](https://demos.telerik.com/aspnet-mvc/slider)

* [ASP.NET MVC Slider Product Page](https://www.telerik.com/aspnet-mvc/slider)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Client-Side API Reference of the Slider for ASP.NET MVC](https://docs.telerik.com/kendo-ui/api/ui/slider)

* [Server-Side API Reference of the Slider for ASP.NET MVC](https://docs.telerik.com/aspnet-mvc/api/slider)

* [Telerik UI for ASP.NET MVC Breaking Changes](https://www.telerik.com/aspnet-mvc/documentation/backwards-compatibility/2024-backwards-compatibility)

* [Telerik UI for ASP.NET MVC Knowledge Base](https://docs.telerik.com/aspnet-mvc/knowledge-base)
