0

我在我的网站上使用 Colorbox,它在大多数页面上都运行良好。但是在某些使用其他 jQuery 脚本的页面上,它会失败。

我从 IE 的控制台收到此错误:

SCRIPT438:对象不支持属性或方法“colorbox”

这是给我带来麻烦的作品

<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.test').colorbox({iframe:true, width:"50%", height:"75%", top:50, scrolling:false,      onComplete:true});
});
</script>

头部:

<link rel="stylesheet" type="text/css" href="http://www.domain.com/js/calendar/calendar-win2k-1.css" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/base/default/css/widgets.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/aw_blog/css/style.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/onsale/css/product_onsale_label.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/onsale/css/category_onsale_label.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/sidenav.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/sidenavcollapse.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/faq/label.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/mageworx/modalbox.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/icart.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/default/css/prolabel.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/colorbox.css" media="all" />
<link rel="stylesheet" type="text/css" href="http://www.domain.com/skin/frontend/default/teststore/css/print.css" media="print" />
<script type="text/javascript" src="http://www.domain.com/js/jquery/jquery.1.8.2.min.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/colorbox/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/jquery/jquery.noconflict.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/prototype/prototype.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/lib/ccard.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/prototype/validation.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/builder.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/effects.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/dragdrop.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/controls.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/scriptaculous/slider.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/js.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/form.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/menu.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mage/translate.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mage/cookies.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/aw_onsale/onsale.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mageworx/modalbox.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/mageworx/icart.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/varien/product.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/calendar/calendar.js"></script>
<script type="text/javascript" src="http://www.domain.com/js/calendar/calendar-setup.js"></script>
<script type="text/javascript" src="http://www.domain.com/skin/frontend/default/default/js/sidenavcollapse.js"></script>
<script type="text/javascript" src="http://www.domain.com/skin/frontend/default/default/js/faq/faq.js"></script>
<script type="text/javascript" src="http://www.domain.com/skin/frontend/base/default/js/bundle.js"></script>
<link rel="canonical" href="http://www.domain.com/" />

会不会是某种冲突?

4

2 回答 2

0

经过大量搜索不同页面的源代码后,我发现正在加载多个 magento 扩展,各种不同的 jQuery 库,各种版本..

在评论所有这些之后,它再次完美无缺!

注意自己和其他人,只有 1 个 jQuery 库!

于 2013-02-05T20:41:33.040 回答
-1

很可能,它在其他浏览器中的性能如何,您是否尝试过精简到最少的代码来查看它是如何运行的?

于 2013-02-05T19:17:15.960 回答