magari per non utiliìzzare tante volte quei blocchi di codice tante quante sono gli utilizzi che devi fare potresti raccogliere tutto in una sotto funzione del tipo magari
Codice PHP:
function aggiungievento(contenitore,indietro,avanti)
{
window.addEvent('domready', function(){
var totIncrement = 0;
var increment = 212;
var maxRightIncrement = increment*(-6);
var fx = new Fx.Style(contenitore, 'margin-left', {
duration: 1000,
transition: Fx.Transitions.Back.easeInOut,
wait: true
});
//-------------------------------------
// EVENTS for the button "previous"
$(indietro).addEvents({
'click' : function(event){
if(totIncrement<0){
totIncrement = totIncrement+increment;
fx.stop()
fx.start(totIncrement);
}
}
});
//-------------------------------------
// EVENTS for the button "next"
$(avanti).addEvents({
'click' : function(event){
if(totIncrement>maxRightIncrement){
totIncrement = totIncrement-increment;
fx.stop()
fx.start(totIncrement);
}
}
})
});
}
e richiamarla cosi
aggiungievento("myList1","previous1","next1");
aggiungievento("myList2","previous2","next1");
Non l'ho testata ma "potrebbe" funzionare