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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top