简体   繁体   中英

Jquery Bootstrap Slider not working

Relevant code snippets are below - What am I doing wrong???

Here's the gem I'm using: https://github.com/stationkeeping/bootstrap-slider-rails

APPLICATION.CSS

* = require_bootstrap-slider

APPLICATION.JS

//
= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
= require underscore
= require gmaps/google
= require bootstrap-slider

INDEX.HTML.ERB

<script>$("#ex8").slider({
            tooltip: 'always'
        });
        </script>
        <input id="ex8" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="14"/>

STYLESHEETS DIRECTORY

在此处输入图片说明

JS DIRECTORY

在此处输入图片说明

THIS IS WHAT I SEE

在此处输入图片说明

CONSOLE - ERRORS

在此处输入图片说明

Try updating application.js and css to

Application.js

//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require underscore
//= require gmaps/google
//= require bootstrap-slider

Application.css

*= require_bootstrap-slider

My personal preference is to use a CDN

app/views/layouts/application.html.erb

<%= stylesheet_link_tag '//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css' %>
<%= javascript_include_tag '//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js' %>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM