roundslider tooltip format example

roundslider tooltip format example

by Soundar Pandian

HTML

<script src="https://cdn.jsdelivr.net/jquery.roundslider/1.2/roundslider.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.roundslider/1.2/roundslider.min.css">
<h2><a target="_blank" href="http://roundsliderui.com/">roundSlider</a></h2> <br/>

<div id="slider"></div>

<div id="slider1"></div>

CSS

.rs-control {
  float: left;
  margin-left: 20px;
}

JavaScript

////*** define the function and use ***////
window.formatter = function (e) {
  return "€ " + e.value;
}

$("#slider").roundSlider({
  sliderType: "min-range",
  value: 45,

  tooltipFormat: "formatter"
});

////*** or use the inline function like below ***////
$("#slider1").roundSlider({
  sliderType: "min-range",
  value: 45,

  tooltipFormat: function (e) {
  	return "$ " + e.value;
	}
});