Created
January 14, 2013 20:24
-
-
Save adatta02/4533052 to your computer and use it in GitHub Desktop.
Use jQuery UI slider and Bootstrap tooltips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#user-score-div").slider({ | |
max: 100, min: 0, value: val, | |
change: function(e, ui){ | |
$("#custom_segment_minimum_user_score").val( ui.value ); | |
}, | |
slide: function(e, ui){ | |
var pos = $.extend({}, $(ui.handle).offset(), | |
{ width: $(ui.handle).get(0).offsetWidth, | |
height: $(ui.handle).get(0).offsetHeight}); | |
var actualWidth = $(".tooltip:first").get(0).offsetWidth; | |
$(".tooltip:first").css("left", pos.left + pos.width / 2 - actualWidth / 2); | |
$(".tooltip:first .tooltip-inner").text( ui.value ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment