javascript获胜的原因'我不在Twitter上工作;s Bootstrap,即使在调用函数和js文件时也
Why javascript won't work in Twitter's Bootstrap even when calling the function and the js file?
我无法让javascript与Twitter的Bootstrap一起工作。
我有这个
<p>
<a href="#" rel="tooltip" title="first tooltip" id="example">
hover over me
</a>
</p>
我希望它显示为工具提示。
它不起作用,所以我在HEAD:中添加了这个
<script type="text/javascript">
window.onload = function()
{
if(!window.jQuery)
{
alert('jQuery not loaded');
}
else
{
$(document).ready(function(){
$('#example').tooltip({'placement':'top', 'trigger' : 'hover'});
});
}
}
注意到它仍然不起作用,我删除了页面内的所有脚本引用,只在HEAD:中添加了这个
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tooltip.js"></script>
我没有调用我下载的任何特定文件,而是热链接原始文件,但工具提示仍然不会出现。
注意:我正在尝试设置一个新的Drupal主题,所以我的网站在Drupal内部(页面是一个tpl.php文件)。
感谢您的真知灼见!!
如果你想直接使用github文件,你需要使用原始文件,所以你应该指向https://raw.github.com/twitter/bootstrap/master/js/bootstrap-tooltip.js不https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tooltip.js
相关文章:
- Twitter Bootstrap typeahead:使用“this”获取上下文/调用元素
- HTML5(Bootstrap)通过函数调用运行动画
- 从Bootstrap Dropdown中选择后调用javascript
- PHP,MySQL,AJAX-调用AJAX结果后,Bootstrap CSS样式不会显示
- 从 Bootstrap Typeahead 中的数据属性中调用函数
- 在ajax回调(safari)中调用bootstrap模式显示
- 如何使用Bootstrap(C#,VS2013)从CodeFile调用方法
- 通过JavaScript调用Bootstrap modal
- BootStrap Django Jquery Modal在Ajax调用提交时未关闭
- 如何在Bootstrap 2.3.2中弹出dropup之前调用函数
- UI Bootstrap for Angular 带有 'collapse' 指令,不调用 expand
- Bootstrap datepicker 传递给 c# ajax 调用
- Meteor 和 Bootstrap 表,如何调用 detailFormatter 函数
- 在Bootstrap面板展开中调用事件
- 从HTML页面调用Bootstrap函数
- 调用bootstrap在url中显示哈希链接,当用户点击页面滚动(锚)
- 如何使用jQuery调用Bootstrap alert
- 我如何从PHP调用Bootstrap模式
- React调用bootstrap函数
- 如何在ES6中调用bootstrap's jQuery插件