Я показываю серию элементов, используя следующую() функцию. Как только я дойду до конца, я хочу перейти к первому элементу. Любые идеи?
Здесь код:
//Prev / Next Click
$('.nextSingle').click( function() {
//Get the height of the next element
var thisHeight = $(this).parent().parent().parent().next('.newsSingle').attr('rel');
//Hide the current element
$(this).parent().parent().parent()
.animate({
paddingBottom:'0px',
top:'48px',
height: '491px'
}, 300)
//Get the next element and slide it in
.next('.newsSingle')
.animate({
top:'539px',
height: thisHeight,
paddingBottom:'100px'
}, 300);
});
В принципе мне нужен оператор "if", который гласит: "Если нет оставшихся" следующих "элементов, тогда найдите первый.
Спасибо!