我在我的 magento 商店中使用以下脚本制作标签幻灯片。看起来它正在导致 jQuery 冲突。我尝试使用jQuery.noConflict()
但没有帮助。
<script type="text/javascript">
var current = 0;
$('tabs').firstDescendant().className += ' active-tab';
var active_tab = $('tabs').firstDescendant().firstDescendant().firstDescendant();
var motion = false;
function move_to(to, el){
if (!motion) {
el.parentNode.parentNode.className += ' active-tab';
if (active_tab) {
active_tab.parentNode.parentNode.className = 'corner-left-top';
}
active_tab = el;
move = (current - to)*690;
new Effect.Move($('tabber'), { x: move, beforeStart:function(){ motion = true;},afterFinish:function(){motion = false;}});
current = to;
}
}
</script>
这是脚本的 PHP 代码:
<div id="tabs" class="tabs">
<?php $tabs = 0; ?>
<?php if ($_description = $this->getChildHtml('description')): ?>
<div id="width-tab" class="corner-left-top">
<div class="corner-right-top" >
<div class="border-top" onclick="move_to(<?php echo $tabs; $tabs++;?>, this)">
<h3 style="color:#000;"><?php echo strtoupper($this->__('Overview')); ?></h3>
</div>
</div>
</div>
<?php endif;?>
<div id="width-tab-2" class="corner-left-top">
<div class="corner-right-top">
<div class="border-top" onclick="move_to(<?php echo $tabs; $tabs++;?>, this)">
<h3 ><?php echo strtoupper($this->__('Specification')); ?></h3>
</div>
</div>
</div>
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<div id="width-tab-3" class="corner-left-top">
<div class="corner-right-top">
<div class="border-top" onclick="move_to(<?php echo $tabs; $tabs++;?>, this)">
<h3><?php echo strtoupper($this->__('Buy')); ?></h3>
</div>
</div>
</div>
<?php endif; ?><br class="clear-block" />
<ul id="tabber">
<li id="container_1" class="tabs-list">Product Description</li>
<li id="container_2" class="tabs-list">Product Specifications</li>
<li id="container_3" class="tabs-list">Add to Cart button</li>
</ul>
问题:
id container_3 包含一个“添加到购物车”按钮<button type="button" title="Add to Cart" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span>Add to Cart</span></span></button>
,该按钮不起作用。
请任何帮助将不胜感激。
谢谢