简体   繁体   English

JScrollPane和Fancybox冲突-Fancybox无法正常工作

[英]JScrollPane and Fancybox conflict - Fancybox doesn't work

I'm setting up a gallery, with the pictures in a wide window in the middle of the page, controlled by a scrollbar. 我正在建立一个画廊,页面中间的宽窗口中的图片由滚动条控制。 I've also set up a page with a form used to contact the artist to arrange a sale, and I want this page to open in a fancybox window. 我还设置了一个页面,该页面带有用于联系艺术家以安排销售的表格,我希望此页面可以在fancybox窗口中打开。 The link to the form works, but it will not open in a fancybox window. 表单的链接有效,但不会在fancybox窗口中打开。

The scripts in the head of the page are as follows: 页面顶部的脚本如下:

<script type="text/javascript"    src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="js/jquery.jscrollpane.min.js"></script>

<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.js"></script>

<script type="text/javascript" id="sourcecode">
$(function() {
$('.scroll-pane').jScrollPane();
});
</script>

<script>    
$(function() {
$('.iframe').fancybox({
    width : '50%',
    height : '80%',
    titlePosition: 'outside'
}); // end fancybox
}); // end ready
</script>

The link meant for a fancy box window looks like this on the page: 页面上用于花式框窗口的链接如下所示:

<li><a href="form.html" class="iframe">buy</a></li>

My JS console says that it "Cannot read property 'msie' of undefined" in the JQuery fancybox file, and also that $('.iframe').fancybox({ is not a function, but it all seems to work fine in various tutorials and experiments I've pursued where JScrollPane is out of the picture. 我的JS控制台说它在JQuery fancybox文件中“无法读取未定义的属性'msie',并且$('.iframe').fancybox({不是一个函数,但在所有情况下似乎都可以正常工作我在JScrollPane超出画面的地方进行了教程和实验。

The problem is you are using an old version of fancybox and new version of jquery. 问题是您正在使用旧版本的fancybox和新版本的jquery。

Old version of fancybox depends on jquery.browser which is remove in all versions from jquery 1.9. fancybox的旧版本取决于jquery.browser ,该版本已从jquery 1.9的所有版本中删除。

either use jquery migrate file or use the latest fancybox 使用jquery迁移文件或使用最新的fancybox

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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