我使用的是Magento 1.7.0.2版本
我想在我的产品页面中添加 3 个 jquery div default\template\catalog\product\view.phtml
<script>
$(function() {
$( "#3tabs_product" ).tabs();
});
</script>
<div id="3tabs_product">
<ul>
<li><a href="#tabs-1">Product Informatie</a></li>
<li><a href="#tabs-2">Leveringsvoorwaarden</a></li>
<li><a href="#tabs-3">Beoordelingen</a></li>
</ul>
<div id="tabs-1">Product Informatie.</div>
<div id="tabs-2">Leveringsvoorwaarden</div>
<div id="tabs-3">Beoordelingen</div>
</div>
问题是,为了运行这 3 个选项卡,我必须包含 两行 jquery ui 和 jquery 就在上面的代码之上
<script src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
但这“破坏”了我使用 jquery1.7.1 的 TopMenulinks ! 我的添加到购物车功能是 javascript。
如果我包含 2 个 jquery 行,则选项卡没问题 但是下拉菜单和“添加到购物车”会中断 .... 如果我删除这些行,菜单将恢复并且添加到购物车再次起作用。 但如果不包含这两行,3Tab 就无法工作!!!
我该怎么办???
最佳答案
<script type="text/javascript">
$.noConflict(); //Use no conflict here instead of js file
// Code that uses other library's $ can follow here.
</script>
您可以更改库文件的启动顺序。在 page.xml 中更改顺序如下
- jquery.js
- noconflict.js
- prototype.js 这将避免 IE8 中的错误。
将此添加到您的 html 页面可以解决您的问题。
请告诉我是否可以为您提供更多帮助。
关于php - 如何在 Magento 1.7.0.2 中的product\view.phtml 中包含 jquery 选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18696172/