bootstrap-slider
bootstrap-slider copied to clipboard
Question : why ticks label are not in the tick HTML element ?
Hello, My problem is that I'm in horizontal orientation and I would like to adapt the slider's width to the parent. So, I've set the width to 100% but the tick' labels have a calculated width in px and before a click or a window resize, labels are wrong-positioned, while ticks a well positioned.
After looking at source code, I have a question : why the HTML element corresponding to the label is not inside the HTML element representing the tick ?
Try calling refresh on the slider instance after resizing is done.
OK, I have called the refresh method on the window.load event. I could tell that it's working but I have a blinking display : labels are shown at a first position, then the refresh occurs and move the labels at their right positions.
Why don't you instantiate the slider on this event ? This way, the size of elements is known and tick labels will be well positioned.
var self = this;
$(window).load(function(){
instance = new PluginClass( self, options );
$.data( self, namespace, instance );
});