我正试图让这个基本的Bootstrap滑块正常工作,但这只是让我不知所措。
http://getbootstrap.com/ bootstrap
http://www.eyecon.ro/bootstrap-slider/引导滑块
我正在尝试实现这一点,但无法弄清楚它为什么不起作用。我已确认jQuery 1.8.3
在服务器上运行。我已经包含了Bootstrap 3.0.3
的CSS / JS。我已经包含了Bootstrap Slider的CSS / JS。
以下是我试图让它运行的代码:
<div class="row">
<div class="col-md-6">
<input type="text" id="foo" class="span2" value="" data-slider-min="-20" data-slider-max="20" data-slider-step="1" data-slider-value="-14" data-slider-orientation="horizontal" data-slider-selection="after"data-slider-tooltip="hide">
<input type="text" id="bar">
<script type="text/javascript">
$('#foo').slider().on('slide', function(ev) { $('#bar').val(ev.value); });
</script>
</div>
</div>
所有我得到的是两个文本输入框,但不是滑块。有什么想法吗?
答案 0 :(得分:0)
我建议你安装最新版本的jQuery来解决你的问题。我有一个类似的问题,一旦我安装了最新版本的jQuery就解决了。祝你好运。
答案 1 :(得分:0)
为您的网站使用Bootstrap4。首先,从其官方网站https://getbootstrap.com/安装bootstrap4,或者您也可以在Index.html文件中添加CSS链接和JS脚本。另外,在bootstrap js脚本上方添加jquery文件。 复制之后,请使用以下代码来创建专业的轮播: