Hello,
I have a question. I have a javascript file, see below:
- $(function() {
-
- var currentPage = 1;
-
- $('#slider .buttons span').live('click', function() {
- var timeout = setTimeout(function() {$("img").trigger("slidermove")}, 300);
- var fragments_count = $(this).parents('#slider:eq(0)').find('.fragment').length;
- var fragmet_width = $(this).parents('#slider:eq(0)').find('.fragment').width();
- var perPage = 5;
- var numPages = Math.ceil(fragments_count/perPage);
- var stepMove = fragmet_width*perPage;
- var container = $(this).parents('#slider:eq(0)').find('.content');
- var firstPosition = 0;
- var lastPosition = -((numPages-1)*stepMove);
-
- if ($(this).hasClass('next')) {
- currentPage ++;
- if (currentPage > numPages) {
- currentPage = 1;
- container.animate({'left': firstPosition});
- return;
- };
- container.animate({'left': -((currentPage - 1)*stepMove)});
- };
- if ($(this).hasClass('prev')) {
- currentPage --;
- if (currentPage < 1) {
- currentPage = numPages;
- container.animate({'left': lastPosition});
- return;
- };
- container.animate({'left': -((currentPage-1)*stepMove)});
- };
- });
- });

When you click on a thumbnail it opens a page with the image and the text. When I click on the ">" next button there comes another 5 images and when I click on one of those, a new page will come and the slider will go back to the beginning. If I even try to type currentPage = 2; in the .js file, it will still begin on the first page of the slider. I'm stuck for hours already so if anybody can help me you will be my hero. So.. anybody knows or any suggestions how to call page 2 ?
Thank you in advance!