From b98a492c49504254848b25e731fdd6102afaeff9 Mon Sep 17 00:00:00 2001 From: Gleydson Costa Date: Fri, 29 Jun 2012 16:46:53 -0300 Subject: [PATCH] Setting the current page in the options. --- jquery.touchslider.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jquery.touchslider.js b/jquery.touchslider.js index 1333e42..d4f272c 100644 --- a/jquery.touchslider.js +++ b/jquery.touchslider.js @@ -29,10 +29,11 @@ http://touchslider.com pagination: "." + namespace + "-nav-item", currentClass: namespace + "-nav-item-current", duration: 350, - mouseTouch: true + mouseTouch: true, + page: 0 // [container, scroller] }, options); - + var ret = { current: 0, step: step, @@ -191,7 +192,7 @@ http://touchslider.com // right calc, [3,4] var leftInR = nodeLeft; - + for (i = indexInViewport + 1; i < l; i++) { leftInR += slides.eq(inViewport[i]).outerWidth() + options.margin; endCoords[i] = leftInR; @@ -631,6 +632,10 @@ http://touchslider.com if (options.autoplay) { start(); } + + if(options.page){ + step(options.page); + } container.data(namespace, ret); }; @@ -642,3 +647,4 @@ http://touchslider.com return this; }; }(jQuery)); +