【发布时间】:2013-11-08 19:23:39
【问题描述】:
我的 Magento 网站似乎无法将 jQuery 与 Prototype 分开。
我已经使用更改的标签等在 JsFiddle 上运行它,但是当我将它添加到我的 magento 网站时,我不断收到未捕获的语法错误。
页面位于http://www.asg.co.uk/gadgetclinic/how-it-works
我正在使用的代码是:
<script type="text/javascript">
// First hide them all
$j("#how-it-works .step").hide();
function fades($j.step) {
$j div.fadeIn(300, function () {
if (!$j div.is('last-child')) {
fades($div.next());
}
else{
fades($j("#how-it-works .step:first-child"));
}
});
}
fades($("#how-it-works .step:first-child"));
</script>
HTML 代码是:
<div id="how-it-works">
<img src="{{skin url="images/how-it-works.png"}}" alt="How It Works" />
<div class="step"><h3>Get your box</h3><p>We'll send a suitably sized, pre-paid postage box for your device.</p></div>
<div class="step"><h3>Post your device</h3><p>Safely pack your device in your postage box and return it to us.</p></div>
<div class="step"><h3>Repair in process</h3><p>We will update you if need be whilst your device is repaired.</p></div>
<div class="step"><h3>Get your device</h3><p>Your device will be returned using the service you selected.</p></div>
</div>
谁能帮助我系统地帮助将所有必需的 $ 标签放入 $j 或将 jQuery 与 Prototype 分开所需的任何东西?
【问题讨论】:
标签: javascript jquery magento prototype conflict