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

touch functionality added even though touch:false #76

Open mdoelker opened 10 years ago

mdoelker commented 10 years ago

When including the touch plugin, the touch functionality is always initialized when the carousel is created even though the touch option is false.

I think the _create method is lacking a check similar to what can be found in the autoscroll plugin:

_create: function () {

    _super._create.apply(this);

    if (!this.options.touch) { // <-- Hey, I'm new here
        return;
    }

    this._initDrag();

    return;
},

This is on v1.0.2. I'm using { touch: Modernizr && Modernizr.touch } like it was stated in the docs.

richardscarrott commented 9 years ago

Good spot, feel free to send a pull request and I'll merge it in!