File: /var/www/html/wpprm/wp-content/themes/ronneby/assets/js/jCarouselSwipe.min.js
/*
* Project: jCarouselSwipe.js
* Description: Plugin that add touch controls for jCarousel.
* Author: @felquis
* License: MIT
* GitHub : github.com/felquis/jCarouselSwipe
*/
!function(n,t,i){function o(t,i){this.element=t,this.options=n.extend({},r,i),this._defaults=r,this._name=e,this.init()}var e="touch",r=(t.document,{});o.prototype.init=function(){if(Hammer==i||Modernizr==i)return!1;if(!Modernizr.touch)return!1;var o=n(this.element);if(!o.data("jcarousel"))return!1;var t=new Hammer(o.get(0));direction={left:function(){o.jcarousel("scroll","+=1")},right:function(){o.jcarousel("scroll","-=1")}},init=init=parseFloat(o.find("ul").css("left").replace("px","")),oudGo=0,goDirection="left",t.ondragstart=function(){init=init=parseFloat(o.find("ul").css("left").replace("px",""))},t.ondrag=function(t){var i=.5*t.distanceX,n=init+i;oudGo>i?i<900&&(o.find("ul").css("left",n),goDirection="left"):oudGo<i&&i<900&&(o.find("ul").css("left",n),goDirection="right"),oudGo=i},t.ondragend=function(t){oudGo=0,direction[goDirection](t)}},n.fn[e]=function(t){return this.each(function(){n.data(this,"plugin_"+e)||n.data(this,"plugin_"+e,new o(this,t))})}}(jQuery,window);