jquery-plugins - 在单个项目中使用 Bootstrap 和 Fancybox

标签 jquery-plugins twitter-bootstrap fancybox javascript-namespaces

我在单个项目中使用 Bootstrap 和 Fancybox,包括它:

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>

这些文件存在并被 Chrome 包含。

创建 Fancybox 元素时:
$(document).ready(function() {
    [...]

    jQuery("a.fancy").fancybox({
        'transitionIn'  : 'none',
        'transitionOut' : 'none'    
    });
});

JS 抛出错误:
Uncaught TypeError: Cannot read property 'msie' of undefined jquery.fancybox-1.3.4.pack.js:18
Uncaught TypeError: Object [object Object] has no method 'fancybox'

( Bootstrap 功能正在工作)

这是命名空间问题吗?

最佳答案

DOM 是在调用 fancybox 之前加载的吗?如果不试试这个:

$(document).ready(function() {
    $('a.fancy').fancybox({
        'transitionIn'  : 'none',
        'transitionOut' : 'none'
    });
});

关于jquery-plugins - 在单个项目中使用 Bootstrap 和 Fancybox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14348749/

相关文章:

javascript - 获取 Laravel Controller 中的 Js 值

html - 中心进度条说明

javascript - 如何使输入组在完成书写后或单击任意位置时折叠?

jquery - Croppie 在 Jquery Fancybox 弹出模式中不起作用

javascript - fancyBox 中的重复图像

javascript - Jarvis.widget 不会在 AngularJS ng-repeat 中渲染

javascript - 在自定义 Jquery 插件中获取数据

jQuery制作插件?

html - 在 div 上应用 Bootstrap & Flat UI 或复制所有样式以在导航栏上使用

javascript - fancybox 使鼠标滚轮淡入图片水平