如何在Magento 1.7.0.2的product \ view.phtml中包含jquery选项卡 [英] How include jquery tabs in product\view.phtml in Magento 1.7.0.2
问题描述
我正在使用Magento 1.7.0.2版本
I am using Magento 1.7.0.2 version
我想在产品页面的 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>
问题是这三个选项卡要运行,我必须包括 两行jquery ui和jquery刚好在它们之上的代码
The problem is that the these 3 tabs in order to run, I have to include two lines of jquery ui and jquery JUST ABOVE THE CODE ABOVE THEM
<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.
But this "breaks" my TopMenulinks which are using jquery1.7.1 ! and my add to cart function which is javascript.
如果我包括2条jquery行,则选项卡还可以 ,但是下拉菜单和添加至购物车休息时间" .... 如果我删除了这些行,菜单将恢复,然后添加到购物车将再次起作用. 但是如果不包括这两行,则3Tab不能正常工作!!!
If I include the 2 jquery lines the tabs are ok but the dropdown menu and the "add to cart breaks" .... If I remove the lines the menu is restored and the add to cart works again. But without including the two lines the 3Tabs are not working!!!
我应该怎么做?
推荐答案
<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中,更改顺序如下
You may change the order of library file initiating. In page.xml change order as below
- jquery.js
- noconflict.js
- prototype.js,这将避免IE8中的错误.
将此添加到您的html页面可以解决您的问题.
Add this to your html page can solve your issue.
让我知道我能否为您提供更多帮助.
let me know if i can help you more.
这篇关于如何在Magento 1.7.0.2的product \ view.phtml中包含jquery选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!