我似乎無法使用我的Magento網站將Prototype與Prototype分開。Jquery與原型magento衝突 - 我如何分離?
我已經得到它使用更改標籤等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?
那麼,我需要將所有原來的$標記還原爲$ j返回$,並將所有內容放入包含$ j的函數包裝中? –
對不起從編輯中不清楚如何編寫它...我已經有一個腳本部分說var $ j = jQuery.noConflict();幾行以上... –
@leecollings它的工作? – vladkras