我想弄清楚如何让我的Rails 4应用程序中的弹出工作。Rails 4 - Bootstrap Popovers - js不工作
我在我的应用程序中有bootstrap-sass gem。按照文件,我已经列入我的application.js文件中的以下内容:
/= require jquery
//= require bootstrap
我也曾尝试调换需要引导的需要引导链轮(但是它没有什么区别)。
我在我的JavaScript的另一个文件夹名为organisations.js.coffee,具有:
$('label-with-popover').popover(placement: 'right')
在我看来,我试图让酥料饼的工作,我有:
<button type="button" class="label-with-popover" class="btn btn-default" data-toggle="popover" data-placement="top" data-content="netwerewerwrwe" data-title="test"><i class="fa fa-info-circle"></i></button>
当我尝试这个时,当我点击它时,按钮什么也不做。
任何人都可以看到什么需要发生得到这个工作?我不确定是否应该在咖啡文件中放置脚本标记。我试过了,但对这个问题没有任何影响。
您应该只定义一次类 - 即'class =“label-with-popover btn btn-default”'。有些浏览器只会采用最后一个类的声明,这可能是为什么jquery无法找到它? –