"Bootstrap Pricing Slider (Donations)"
Bootstrap 3.1.0 Snippet by lemkhantar1

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="price-box"> <div class="col-sm-12"> <div id="slider"></div> </div> </div> <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
.price-box { margin: 0 auto; background: #E9E9E9; border-radius: 10px; padding: 40px 15px; width: 500px; } .ui-widget-content { border: 1px solid #bdc3c7; background: #e1e1e1; color: #222222; margin-top: 4px; } .ui-slider .ui-slider-handle { position: absolute; cursor: default; color: #FFFFFF; } .ui-slider .ui-slider-handle .glyphicon { color: #FFFFFF; margin: 0 3px; font-size: 11px; opacity: 0.5; } .ui-corner-all { border-radius: 20px; } .ui-slider-horizontal .ui-slider-handle { top: -.9em; } .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #f9f9f9; background: #3498db; white-space: nowrap; } .ui-slider .ui-slider-handle { cursor: pointer; } .ui-slider a, .ui-slider a:focus { cursor: pointer; outline: none; }
$(document).ready(function() { $("#slider").slider({ value:0, min: 0, max: 100, step: 33.333, slide: function(event, ui) { update(1,ui.value); //changed } }); update(); }); //changed. now with parameter function update(slider,val) { if(val<5)$amount = "Normal"; else if(val<10) $amount = "Important"; else $amount = "T.Important"; $('#slider a').html('<label><span class="glyphicon glyphicon-chevron-left"></span> '+$amount+' <span class="glyphicon glyphicon-chevron-right"></span></label>'); }

Related: See More


Questions / Comments: