-1

In this link

The autoplay skips the last slide. Also when clicked on last slide, autoplay stops and doesn't continue to the first.

Is it possible while autoplay, slide remains in the box and scrolls automatically. As of now the slide disappears in the scroll after 5th slide. Can we make the current slide always visible in the box?

Please help.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Nitin Koli
  • 23
  • 2

1 Answers1

0

in your code: instead of i++, change it with the current index of the cn_item with selected class. it should look like this:

function next() {
    i = $('.cn_item').index($('.selected')) + 1;
    if(i== $('.cn_item.selected').parent().children().length){      
      x=1;

that should fix everything.

  • Now it autoplays perfectly! But, Can we make the current slide visible in the scroll area? As of now it gets hidden after 4th slide unless we scroll down manually. – Nitin Koli Jul 30 '13 at 09:56
  • `function next() { i = $('.cn_item').index($('.selected')) + 1; if(i==4) $('#cn_list').animate({scrollTop: $(this).height()},2000); ....... $(this).children().first().addClass('selected').click(); } }); i=0; $('#cn_list').animate({scrollTop: 0},500); }` inside your next function should look somewhat like this. :D – helloworld0123 Jul 31 '13 at 09:54