richardscarrott / jquery-ui-carousel

jQuery RS Carousel is a responsive and touch-enabled carousel written on top of jQuery and the jQuery UI Widget Factory providing a full and familiar API in less than 2.6kB minified and gzipped.
http://richardscarrott.github.io/jquery-ui-carousel/
192 stars 56 forks source link

Continuous not working with touch plugin #45

Open Wlada opened 11 years ago

Wlada commented 11 years ago

Continuous not working with the touch enable. It works like loop , not like continuous.

Any suggestions how to fix this?

fdussert commented 10 years ago

Hi, I've fixed it by modifying the jquery.rs.carousel-touch.js Line 254 you'll find

if ((this.index === this.getNoOfPages() - 1 && direction === 'next') || (this.index === 0 && direction === 'prev')) { this.goToPage(this.index); } else { this[direction](); }

Just add a test for the continuous option like that

if(this.options.continuous){ this[direction](); }else{ if ((this.index === this.getNoOfPages() - 1 && direction === 'next') || (this.index === 0 && direction === 'prev')) { this.goToPage(this.index); } else { this[direction](); } }

fdussert commented 10 years ago

I just made a PR https://github.com/richardscarrott/jquery-ui-carousel/pull/73