Prev/next functionality not working on new section selection. The idea is that when the the page loads, several slide shows will load and the user will navigate through them with prev/next buttons. When they get to the end of one section, they will select the next section that they want to view. My problem is that the prev/next function doesn't work after the user navigates to a new section.
Here is a JSFiddle. So you don't miss them, the prev/next buttons are the edges of the prev/next slides hanging on the left and right side of the page, respectively. Below is the section of my javascript that I believe is causing the problem.
Thanks
var secName,
slideCount,
centSlide;
liveSec(0);
// Initiate live section
function liveSec(x) {
centSlide = 0;
secName = $('#slider > div:eq('+x+')').attr('id');
slideCount = $('#'+secName+'').children().length;
$('#'+secName+'').children().first().addClass('liveslide').next().addClass('next');
}
// call prev/next functions
$('#'+secName+' > div').click(function() {
var index = $('#'+secName+' > div').index(this);
if (index > centSlide) nextcycle(centSlide, slideCount);
if (index < centSlide) prevcycle(centSlide, slideCount);
return false;
});
// cycle sections
$('#'+secName+' .select').click(function () {
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
$('.liveslide').removeClass('liveslide');
$('.prev').removeClass('prev');
i = $('#'+secName+' .select').index(this);
liveSec(i);
});