Lines Matching +full:g +full:- +full:touch
2 * BxSlider v4.1.1 - Fully loaded, responsive content slider
5 * Copyright 2012, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
8 * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
37 // TOUCH
121 // merge user-supplied options with the defaults
140 …tings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings…
141 …tings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings…
160 slider.animProp = '-' + slider.cssPrefix + '-transform';
182 el.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>');
183 // store a namspace reference to .bx-viewport
186 slider.loader = $('<div class="bx-loading" />');
196 el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
202 // make modifications to the viewport (.bx-viewport)
211 // make modification to the wrapper (.bx-wrapper)
228 // if "fade" mode, add positioning and z-index CSS
235 // prepare the z-index on the showing element
239 slider.controls.el = $('<div class="bx-controls" />');
243 slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
315 var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
316 var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
343 // if touchEnabled is true, setup the touch events
368 for (i = 1; i <= slider.settings.maxSlides - 1; i++){
371 children = children.add(slider.children.eq(i - 1));
383 // add user-supplied margins
385 height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
403 …tings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings…
415 // start with any user-supplied slide width
427 …// newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / sl…
429 …newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slide…
509 … setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);
512 var lastShowingIndex = slider.children.length - slider.settings.minSlides;
515 setPositionProperty(-position.top, 'reset', 0);
522 if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
525 if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
526 else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
536 * - the animating property's value
539 * - the type of instance for which the function is being
542 * - the amount of time (in ms) the transition should occupy
545 * - an optional parameter containing any variables that need to be passed in
552 // add the CSS transition-duration
553 el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
557 // bind a callback method - executes when CSS transition completes
567 el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
569 // bind a callback method - executes when CSS transition completes
612 slider.pagerEl.addClass('bx-custom-pager');
615 slider.pagerEl.addClass('bx-default-pager');
619 …pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-l…
631 slider.pagerEl = $('<div class="bx-pager" />');
637 slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
652 slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
653 slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
668 slider.controls.directionEl = $('<div class="bx-controls-direction" />');
672 slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
680 …slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slid…
681 …slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider…
683 slider.controls.autoEl = $('<div class="bx-controls-auto" />');
685 slider.controls.autoEl.delegate('.bx-start', 'click', clickStartBind);
686 slider.controls.autoEl.delegate('.bx-stop', 'click', clickStopBind);
699 slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
715 $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
724 * - DOM event object
737 * - DOM event object
750 * - DOM event object
761 * - DOM event object
772 * - DOM event object
778 var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
788 * - index of slide to make active
818 }else if(slider.active.index == getPagerQty() - 1 && slider.carousel){
819 position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
821 }else if(slider.active.index == slider.children.length - 1){
822 position = slider.children.eq(slider.children.length - 1).position();
824 if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0);; }
825 … else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0);; }
837 * - the new state of the auto show
846 slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
863 }else if(slider.active.index == getPagerQty() - 1){
915 el.append(slider.children.clone().addClass('bx-clone'));
918 el.prepend(slider.children.clone().addClass('bx-clone'));
920 startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
943 var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
952 * Runs a continuous loop, news ticker-style
960 position = el.find('.bx-clone').first().position();
961 // if "prev" animate left position to 0, then reset left to first non-clone child
965 var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
966 var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
972 * Initializes touch events
975 // initialize object to contain all touch values
976 slider.touch = {
987 * - DOM event object
993 // record the original position when touch starts
994 slider.touch.originalPos = el.position();
996 // record the starting touch x, y coordinates
997 slider.touch.start.x = orig.changedTouches[0].pageX;
998 slider.touch.start.y = orig.changedTouches[0].pageY;
1010 * - DOM event object
1015 var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
1016 var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
1028 var change = orig.changedTouches[0].pageX - slider.touch.start.x;
1029 value = slider.touch.originalPos.left + change;
1032 var change = orig.changedTouches[0].pageY - slider.touch.start.y;
1033 value = slider.touch.originalPos.top + change;
1043 * - DOM event object
1050 slider.touch.end.x = orig.changedTouches[0].pageX;
1051 slider.touch.end.y = orig.changedTouches[0].pageY;
1054 var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1056 slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
1064 distance = slider.touch.end.x - slider.touch.start.x;
1065 value = slider.touch.originalPos.left;
1067 distance = slider.touch.end.y - slider.touch.start.y;
1068 value = slider.touch.originalPos.top;
1116 * - the destination slide's index (zero-based)
1119 * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1130 slider.active.index = getPagerQty() - 1;
1146 slider.active.last = slider.active.index >= getPagerQty() - 1;
1157 // fade out the visible child and reset its z-index value
1176 var lastChild = slider.children.eq(slider.children.length - 1);
1179 moveBy = slider.viewport.width() - lastChild.outerWidth();
1182 var lastShowingIndex = slider.children.length - slider.settings.minSlides;
1188 …des == 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider…
1189 var lastChild = el.children('.bx-clone').eq(eq);
1194 position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
1196 // normal non-zero requests
1203 * (e.g. if you destroy the slider on a next click),
1207 var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
1230 var pagerIndex = parseInt(slider.active.index) - 1;
1238 * - if true, auto controls state will not be updated
1255 * - if true, auto controls state will not be updated
1268 * Returns current slide index (zero-based)
1286 slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth());
1293 if (slider.active.last) slider.active.index = getPagerQty() - 1;
1310 $('.bx-clone', this).remove();
1320 $('.bx-caption', this).remove();
1327 * Reload the slider (revert all DOM changes, and re-initialize)