From 518db1ccd0c97720af3a18fd8f5482ba8296512c Mon Sep 17 00:00:00 2001 From: dohoons Date: Fri, 22 Apr 2016 19:18:54 +0900 Subject: [PATCH] 1.1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 버그 수정. move 함수 기능 통합. jsHint 적용 --- jquery.touchSlider.js | 114 ++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 60 deletions(-) diff --git a/jquery.touchSlider.js b/jquery.touchSlider.js index efe6e84..c474331 100644 --- a/jquery.touchSlider.js +++ b/jquery.touchSlider.js @@ -2,7 +2,7 @@ * @name jQuery.touchSlider * @author dohoons ( http://dohoons.com/ ) * - * @version 1.1.3 + * @version 1.1.4 * @since 201106 * * @param Object settings 환경변수 오브젝트 @@ -30,7 +30,11 @@ */ -(function ($) { +/* global jQuery */ + +;(function ($) { + + "use strict"; $.fn.touchSlider = function (settings) { @@ -106,10 +110,10 @@ this._drag = false; this._link = true; this._scroll = false; - this._btn_prev; - this._btn_next; - this._timer; this._hover_tg = []; + this._btn_prev = null; + this._btn_next = null; + this._timer = null; this._tg .off("touchstart", this.touchstart) @@ -138,7 +142,7 @@ if(this._len % this._view > 0) { var blank = $(document.createElement(this._list.eq(0).prop("tagName"))).hide(); var cnt = this._view - (this._len % this._view); - for(var i=0; i= 0) || (this._drag && tmp_pos[p-1] > 0)) { - for(var i=0; i -1) ? speed : this._speed, + var speed = (spd > -1) ? spd : this._speed, gap = d * (this._item_w * this._view), - list = this._list, - len = this._len, - transition = speed + "ms ease", - transform = ""; + list = this._list; if(btn_click) this.position(d); - if(this._left == 0 || (!this.opts.roll && this.limit_chk()) ) gap = 0; + if(this._left === 0 || (!this.opts.roll && this.limit_chk()) ) gap = 0; - if(this.opts.supportsCssTransitions && this.opts.transition) { - for(var i=0; i 0) || (this._start[last_p] == 0 && this._left < 0) ); + return ( (this._start[0] === 0 && this._left > 0) || (this._start[last_p] === 0 && this._left < 0) ); }, - go_page : function (i, e) { + go_page : function (i) { var crt = ($.inArray(0, this._pos) / this._view) + 1; var cal = crt - (i + 1); - while(cal != 0) { + while(cal !== 0) { if(cal < 0) { this.animate(-1, true); cal++; @@ -482,7 +476,7 @@ obj : this, total : Math.ceil(this._len / this._view), current : ($.inArray(0, this._pos) / this._view) + 1 - } + }; }, counter : function () {