bootstrap-carousel-swipe icon indicating copy to clipboard operation
bootstrap-carousel-swipe copied to clipboard

Touch Swipe also in desktop mode

Open kampiamodikuesto opened this issue 8 years ago • 0 comments

Hi, i'm finding a way to make this script useful also for desktop mode so i try addending this code:

...

this.$element
      .on('touchstart',        $.proxy(this.touchstart,this))
      .on('touchmove',         $.proxy(this.touchmove,this))
      .on('touchend',          $.proxy(this.touchend,this))

      /*  onmousedown, onmousemove, onmouseup */
      .on('onmousedown',        $.proxy(this.onmousedown,this))
      .on('onmousemove',         $.proxy(this.onmousemove,this))
      .on('onmouseup',          $.proxy(this.onmouseup,this))
      /*  END */

      .on('slide.bs.carousel', $.proxy(this.sliding, this))
      .on('slid.bs.carousel',  $.proxy(this.stopSliding, this))

 ...
...

/* onmousedown, onmousemove, onmouseup */
    
  CarouselSwipe.prototype.onmousedown = function(e) {
    if (this.sliding || !this.options.swipe) return;
    
    var touch = e // e.originalEvent.touches ? e.originalEvent.touches[0] : e

...

CarouselSwipe.prototype.onmousemove = function(e) {
    if (this.sliding || !this.options.swipe) return;

    var touch = e // e.originalEvent.touches ? e.originalEvent.touches[0] : e

...

CarouselSwipe.prototype.onmouseup = function(e) {

...

has samone a solution for this? i think the problem is the corrispective of e.orgianlEvent.touches for mouse event.

kampiamodikuesto avatar Aug 19 '17 09:08 kampiamodikuesto