У меня есть этот jQuery-скрипт, который я пытаюсь реализовать в Magento, и я попробовал использовать noConflict, но он все еще не работает. Magento запускает прототип ... Я не знаю ни одного прототипа, так как бы мне перевести этот скрипт из jQuery в Prototype?!
var active = 0; // starts at zero
var list = $('ul');
list.children('li').eq('0').siblings().hide(); // Hide all except first list element
$('.next').bind('click', function() {
active = active == list.children('li').length-1 ? 0 : active + 1;
});
$('.prev').bind('click', function() {
active = active == 0 ? list.children('li').length-1 : active - 1;
});
var getActive = function() {
return list.children('li').eq(active);
};
$('.prev,.next').bind('click', function() {
getActive().fadeIn().siblings().hide();
});