function slide(var) {
if ( parseInt( var.css('marginLeft') ) >= -2160 ){
var.animate({'margin-left': '-='+width}, animationSpeed, function() {
});
}
}
onclick='(document.getElementById('slides'))'
How can I make this function work by replacing the function parameter (var) with the div slides id?