is there any solution to stop dragging when click on the button
.
the documentation do not give proper description
http://www.eyecon.ro/bootstrap-slider/
$("#stopDrag").click(function(){
});
DEMO http://jsfiddle.net/sweetmaanu/npGw2/
Disabling a slider is identical to disabling a checkbox or textarea; add the disabled attribute. A disabled slider can't be changed by user interaction (sliding, clicking or touching), but its value can still be changed using the . set() method. CSS can be used to show the disabled state.
carousel({ interval: false, }); That will make the auto sliding stop because there no Milliseconds added and will never slider next.
Use the [interval]="'0'" input. This will disable the auto-sliding feature. Here's the link to the Carousel Documentation.
Bootstrap slider is an interactive component that lets the user swiftly slide through possible values spread over a desired range. Multi-range slider. Note: You can also see multi-range sliders, but remember, that they do not work with this plugin.
Extend the slider plugin with a enable and disable function like:
<script src="/slider/js/bootstrap-slider.js"></script>
<script>
$.fn.slider.Constructor.prototype.disable = function () {
this.picker.off();
}
$.fn.slider.Constructor.prototype.enable = function () {
if (this.touchCapable) {
// Touch: Bind touch events:
this.picker.on({
touchstart: $.proxy(this.mousedown, this)
});
} else {
this.picker.on({
mousedown: $.proxy(this.mousedown, this)
});
}
}
</script>
Demo: http://bootply.com/83445
Example html:
<div class="container" style="background-color:darkblue;">
<br>
<input id="slide" type="text" class="span2" value="" data-slider-min="-20" data-slider-max="20" data-slider-step="1" data-slider-value="-14" data-slider-orientation="vertical" data-slider-selection="after">
<button id="enable">Enable</button>
<button id="disable">Disable</button>
</div>
example javascript:
$('#slide').slider();
$('#enable').click(function(){ $('#slide').slider('enable') });
$('#disable').click(function(){ $('#slide').slider('disable') });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With