mirror of
https://ghproxy.net/https://github.com/AlxMedia/splits.git
synced 2025-08-26 06:20:51 +08:00
Initial commit
This commit is contained in:
commit
9f13aa6240
389 changed files with 84369 additions and 0 deletions
82
js/jquery.fitvids.js
Normal file
82
js/jquery.fitvids.js
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*jshint browser:true */
|
||||
/*!
|
||||
* FitVids 1.1
|
||||
*
|
||||
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
||||
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
||||
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
||||
*
|
||||
*/
|
||||
|
||||
;(function( $ ){
|
||||
|
||||
'use strict';
|
||||
|
||||
$.fn.fitVids = function( options ) {
|
||||
var settings = {
|
||||
customSelector: null,
|
||||
ignore: null
|
||||
};
|
||||
|
||||
if(!document.getElementById('fit-vids-style')) {
|
||||
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
|
||||
var head = document.head || document.getElementsByTagName('head')[0];
|
||||
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
|
||||
head.appendChild(div.childNodes[1]);
|
||||
}
|
||||
|
||||
if ( options ) {
|
||||
$.extend( settings, options );
|
||||
}
|
||||
|
||||
return this.each(function(){
|
||||
var selectors = [
|
||||
'iframe[src*="player.vimeo.com"]',
|
||||
'iframe[src*="youtube.com"]',
|
||||
'iframe[src*="youtube-nocookie.com"]',
|
||||
'iframe[src*="kickstarter.com"][src*="video.html"]',
|
||||
'object',
|
||||
'embed'
|
||||
];
|
||||
|
||||
if (settings.customSelector) {
|
||||
selectors.push(settings.customSelector);
|
||||
}
|
||||
|
||||
var ignoreList = '.fitvidsignore';
|
||||
|
||||
if(settings.ignore) {
|
||||
ignoreList = ignoreList + ', ' + settings.ignore;
|
||||
}
|
||||
|
||||
var $allVideos = $(this).find(selectors.join(','));
|
||||
$allVideos = $allVideos.not('object object'); // SwfObj conflict patch
|
||||
$allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
|
||||
|
||||
$allVideos.each(function(count){
|
||||
var $this = $(this);
|
||||
if($this.parents(ignoreList).length > 0) {
|
||||
return; // Disable FitVids on this video.
|
||||
}
|
||||
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
||||
if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
|
||||
{
|
||||
$this.attr('height', 9);
|
||||
$this.attr('width', 16);
|
||||
}
|
||||
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
||||
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
||||
aspectRatio = height / width;
|
||||
if(!$this.attr('id')){
|
||||
var videoID = 'fitvid' + count;
|
||||
$this.attr('id', videoID);
|
||||
}
|
||||
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
|
||||
$this.removeAttr('height').removeAttr('width');
|
||||
});
|
||||
});
|
||||
};
|
||||
// Works with either jQuery or Zepto
|
||||
})( window.jQuery || window.Zepto );
|
903
js/jquery.flexslider.js
Normal file
903
js/jquery.flexslider.js
Normal file
|
@ -0,0 +1,903 @@
|
|||
/*
|
||||
* jQuery FlexSlider v2.1
|
||||
* http://www.woothemes.com/flexslider/
|
||||
*
|
||||
* Copyright 2012 WooThemes
|
||||
* Free to use under the GPLv2 license.
|
||||
* http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributing author: Tyler Smith (@mbmufffin)
|
||||
*/
|
||||
|
||||
;(function ($) {
|
||||
|
||||
//FlexSlider: Object Instance
|
||||
$.flexslider = function(el, options) {
|
||||
var slider = $(el),
|
||||
vars = $.extend({}, $.flexslider.defaults, options),
|
||||
namespace = vars.namespace,
|
||||
touch = ("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch,
|
||||
eventType = (touch) ? "touchend" : "click",
|
||||
vertical = vars.direction === "vertical",
|
||||
reverse = vars.reverse,
|
||||
carousel = (vars.itemWidth > 0),
|
||||
fade = vars.animation === "fade",
|
||||
asNav = vars.asNavFor !== "",
|
||||
methods = {};
|
||||
|
||||
// Store a reference to the slider object
|
||||
$.data(el, "flexslider", slider);
|
||||
|
||||
// Privat slider methods
|
||||
methods = {
|
||||
init: function() {
|
||||
slider.animating = false;
|
||||
slider.currentSlide = vars.startAt;
|
||||
slider.animatingTo = slider.currentSlide;
|
||||
slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last);
|
||||
slider.containerSelector = vars.selector.substr(0,vars.selector.search(' '));
|
||||
slider.slides = $(vars.selector, slider);
|
||||
slider.container = $(slider.containerSelector, slider);
|
||||
slider.count = slider.slides.length;
|
||||
// SYNC:
|
||||
slider.syncExists = $(vars.sync).length > 0;
|
||||
// SLIDE:
|
||||
if (vars.animation === "slide") vars.animation = "swing";
|
||||
slider.prop = (vertical) ? "top" : "marginLeft";
|
||||
slider.args = {};
|
||||
// SLIDESHOW:
|
||||
slider.manualPause = false;
|
||||
// TOUCH/USECSS:
|
||||
slider.transitions = !vars.video && !fade && vars.useCSS && (function() {
|
||||
var obj = document.createElement('div'),
|
||||
props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
|
||||
for (var i in props) {
|
||||
if ( obj.style[ props[i] ] !== undefined ) {
|
||||
slider.pfx = props[i].replace('Perspective','').toLowerCase();
|
||||
slider.prop = "-" + slider.pfx + "-transform";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}());
|
||||
// CONTROLSCONTAINER:
|
||||
if (vars.controlsContainer !== "") slider.controlsContainer = $(vars.controlsContainer).length > 0 && $(vars.controlsContainer);
|
||||
// MANUAL:
|
||||
if (vars.manualControls !== "") slider.manualControls = $(vars.manualControls).length > 0 && $(vars.manualControls);
|
||||
|
||||
// RANDOMIZE:
|
||||
if (vars.randomize) {
|
||||
slider.slides.sort(function() { return (Math.round(Math.random())-0.5); });
|
||||
slider.container.empty().append(slider.slides);
|
||||
}
|
||||
|
||||
slider.doMath();
|
||||
|
||||
// ASNAV:
|
||||
if (asNav) methods.asNav.setup();
|
||||
|
||||
// INIT
|
||||
slider.setup("init");
|
||||
|
||||
// CONTROLNAV:
|
||||
if (vars.controlNav) methods.controlNav.setup();
|
||||
|
||||
// DIRECTIONNAV:
|
||||
if (vars.directionNav) methods.directionNav.setup();
|
||||
|
||||
// KEYBOARD:
|
||||
if (vars.keyboard && ($(slider.containerSelector).length === 1 || vars.multipleKeyboard)) {
|
||||
$(document).bind('keyup', function(event) {
|
||||
var keycode = event.keyCode;
|
||||
if (!slider.animating && (keycode === 39 || keycode === 37)) {
|
||||
var target = (keycode === 39) ? slider.getTarget('next') :
|
||||
(keycode === 37) ? slider.getTarget('prev') : false;
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
}
|
||||
// MOUSEWHEEL:
|
||||
if (vars.mousewheel) {
|
||||
slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
|
||||
event.preventDefault();
|
||||
var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
});
|
||||
}
|
||||
|
||||
// PAUSEPLAY
|
||||
if (vars.pausePlay) methods.pausePlay.setup();
|
||||
|
||||
// SLIDSESHOW
|
||||
if (vars.slideshow) {
|
||||
if (vars.pauseOnHover) {
|
||||
slider.hover(function() {
|
||||
if (!slider.manualPlay && !slider.manualPause) slider.pause();
|
||||
}, function() {
|
||||
if (!slider.manualPause && !slider.manualPlay) slider.play();
|
||||
});
|
||||
}
|
||||
// initialize animation
|
||||
(vars.initDelay > 0) ? setTimeout(slider.play, vars.initDelay) : slider.play();
|
||||
}
|
||||
|
||||
// TOUCH
|
||||
if (touch && vars.touch) methods.touch();
|
||||
|
||||
// FADE&&SMOOTHHEIGHT || SLIDE:
|
||||
if (!fade || (fade && vars.smoothHeight)) $(window).bind("resize focus", methods.resize);
|
||||
|
||||
|
||||
// API: start() Callback
|
||||
setTimeout(function(){
|
||||
vars.start(slider);
|
||||
}, 200);
|
||||
},
|
||||
asNav: {
|
||||
setup: function() {
|
||||
slider.asNav = true;
|
||||
slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
|
||||
slider.currentItem = slider.currentSlide;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
|
||||
slider.slides.click(function(e){
|
||||
e.preventDefault();
|
||||
var $slide = $(this),
|
||||
target = $slide.index();
|
||||
if (!$(vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) {
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction, false, true, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
controlNav: {
|
||||
setup: function() {
|
||||
if (!slider.manualControls) {
|
||||
methods.controlNav.setupPaging();
|
||||
} else { // MANUALCONTROLS:
|
||||
methods.controlNav.setupManual();
|
||||
}
|
||||
},
|
||||
setupPaging: function() {
|
||||
var type = (vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
|
||||
j = 1,
|
||||
item;
|
||||
|
||||
slider.controlNavScaffold = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>');
|
||||
|
||||
if (slider.pagingCount > 1) {
|
||||
for (var i = 0; i < slider.pagingCount; i++) {
|
||||
item = (vars.controlNav === "thumbnails") ? '<img src="' + slider.slides.eq(i).attr("data-thumb") + '"/>' : '<a>' + j + '</a>';
|
||||
slider.controlNavScaffold.append('<li>' + item + '</li>');
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
(slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold);
|
||||
methods.controlNav.set();
|
||||
|
||||
methods.controlNav.active();
|
||||
|
||||
slider.controlNavScaffold.delegate('a, img', eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this),
|
||||
target = slider.controlNav.index($this);
|
||||
|
||||
if (!$this.hasClass(namespace + 'active')) {
|
||||
slider.direction = (target > slider.currentSlide) ? "next" : "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.controlNavScaffold.delegate('a', "click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
setupManual: function() {
|
||||
slider.controlNav = slider.manualControls;
|
||||
methods.controlNav.active();
|
||||
|
||||
slider.controlNav.live(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this),
|
||||
target = slider.controlNav.index($this);
|
||||
|
||||
if (!$this.hasClass(namespace + 'active')) {
|
||||
(target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.controlNav.live("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
set: function() {
|
||||
var selector = (vars.controlNav === "thumbnails") ? 'img' : 'a';
|
||||
slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider);
|
||||
},
|
||||
active: function() {
|
||||
slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active");
|
||||
},
|
||||
update: function(action, pos) {
|
||||
if (slider.pagingCount > 1 && action === "add") {
|
||||
slider.controlNavScaffold.append($('<li><a>' + slider.count + '</a></li>'));
|
||||
} else if (slider.pagingCount === 1) {
|
||||
slider.controlNavScaffold.find('li').remove();
|
||||
} else {
|
||||
slider.controlNav.eq(pos).closest('li').remove();
|
||||
}
|
||||
methods.controlNav.set();
|
||||
(slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active();
|
||||
}
|
||||
},
|
||||
directionNav: {
|
||||
setup: function() {
|
||||
var directionNavScaffold = $('<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + vars.nextText + '</a></li></ul>');
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
if (slider.controlsContainer) {
|
||||
$(slider.controlsContainer).append(directionNavScaffold);
|
||||
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer);
|
||||
} else {
|
||||
slider.append(directionNavScaffold);
|
||||
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider);
|
||||
}
|
||||
|
||||
methods.directionNav.update();
|
||||
|
||||
slider.directionNav.bind(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.directionNav.bind("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
update: function() {
|
||||
var disabledClass = namespace + 'disabled';
|
||||
if (slider.pagingCount === 1) {
|
||||
slider.directionNav.addClass(disabledClass);
|
||||
} else if (!vars.animationLoop) {
|
||||
if (slider.animatingTo === 0) {
|
||||
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass);
|
||||
} else if (slider.animatingTo === slider.last) {
|
||||
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass);
|
||||
} else {
|
||||
slider.directionNav.removeClass(disabledClass);
|
||||
}
|
||||
} else {
|
||||
slider.directionNav.removeClass(disabledClass);
|
||||
}
|
||||
}
|
||||
},
|
||||
pausePlay: {
|
||||
setup: function() {
|
||||
var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a></a></div>');
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
if (slider.controlsContainer) {
|
||||
slider.controlsContainer.append(pausePlayScaffold);
|
||||
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer);
|
||||
} else {
|
||||
slider.append(pausePlayScaffold);
|
||||
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider);
|
||||
}
|
||||
|
||||
methods.pausePlay.update((vars.slideshow) ? namespace + 'pause' : namespace + 'play');
|
||||
|
||||
slider.pausePlay.bind(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
if ($(this).hasClass(namespace + 'pause')) {
|
||||
slider.manualPause = true;
|
||||
slider.manualPlay = false;
|
||||
slider.pause();
|
||||
} else {
|
||||
slider.manualPause = false;
|
||||
slider.manualPlay = true;
|
||||
slider.play();
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.pausePlay.bind("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
update: function(state) {
|
||||
(state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').text(vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').text(vars.pauseText);
|
||||
}
|
||||
},
|
||||
touch: function() {
|
||||
var startX,
|
||||
startY,
|
||||
offset,
|
||||
cwidth,
|
||||
dx,
|
||||
startT,
|
||||
scrolling = false;
|
||||
|
||||
el.addEventListener('touchstart', onTouchStart, false);
|
||||
function onTouchStart(e) {
|
||||
if (slider.animating) {
|
||||
e.preventDefault();
|
||||
} else if (e.touches.length === 1) {
|
||||
slider.pause();
|
||||
// CAROUSEL:
|
||||
cwidth = (vertical) ? slider.h : slider. w;
|
||||
startT = Number(new Date());
|
||||
// CAROUSEL:
|
||||
offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
|
||||
(carousel && reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
|
||||
(carousel && slider.currentSlide === slider.last) ? slider.limit :
|
||||
(carousel) ? ((slider.itemW + vars.itemMargin) * slider.move) * slider.currentSlide :
|
||||
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
|
||||
startX = (vertical) ? e.touches[0].pageY : e.touches[0].pageX;
|
||||
startY = (vertical) ? e.touches[0].pageX : e.touches[0].pageY;
|
||||
|
||||
el.addEventListener('touchmove', onTouchMove, false);
|
||||
el.addEventListener('touchend', onTouchEnd, false);
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchMove(e) {
|
||||
dx = (vertical) ? startX - e.touches[0].pageY : startX - e.touches[0].pageX;
|
||||
scrolling = (vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)) : (Math.abs(dx) < Math.abs(e.touches[0].pageY - startY));
|
||||
|
||||
if (!scrolling || Number(new Date()) - startT > 500) {
|
||||
e.preventDefault();
|
||||
if (!fade && slider.transitions) {
|
||||
if (!vars.animationLoop) {
|
||||
dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1);
|
||||
}
|
||||
slider.setProps(offset + dx, "setTouch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchEnd(e) {
|
||||
// finish the touch by undoing the touch session
|
||||
el.removeEventListener('touchmove', onTouchMove, false);
|
||||
|
||||
if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
|
||||
var updateDx = (reverse) ? -dx : dx,
|
||||
target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
|
||||
if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
} else {
|
||||
if (!fade) slider.flexAnimate(slider.currentSlide, vars.pauseOnAction, true);
|
||||
}
|
||||
}
|
||||
el.removeEventListener('touchend', onTouchEnd, false);
|
||||
startX = null;
|
||||
startY = null;
|
||||
dx = null;
|
||||
offset = null;
|
||||
}
|
||||
},
|
||||
resize: function() {
|
||||
if (!slider.animating && slider.is(':visible')) {
|
||||
if (!carousel) slider.doMath();
|
||||
|
||||
if (fade) {
|
||||
// SMOOTH HEIGHT:
|
||||
methods.smoothHeight();
|
||||
} else if (carousel) { //CAROUSEL:
|
||||
slider.slides.width(slider.computedW);
|
||||
slider.update(slider.pagingCount);
|
||||
slider.setProps();
|
||||
}
|
||||
else if (vertical) { //VERTICAL:
|
||||
slider.viewport.height(slider.h);
|
||||
slider.setProps(slider.h, "setTotal");
|
||||
} else {
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
slider.newSlides.width(slider.computedW);
|
||||
slider.setProps(slider.computedW, "setTotal");
|
||||
}
|
||||
}
|
||||
},
|
||||
smoothHeight: function(dur) {
|
||||
if (!vertical || fade) {
|
||||
var $obj = (fade) ? slider : slider.viewport;
|
||||
(dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).height()}, dur) : $obj.height(slider.slides.eq(slider.animatingTo).height());
|
||||
}
|
||||
},
|
||||
sync: function(action) {
|
||||
var $obj = $(vars.sync).data("flexslider"),
|
||||
target = slider.animatingTo;
|
||||
|
||||
switch (action) {
|
||||
case "animate": $obj.flexAnimate(target, vars.pauseOnAction, false, true); break;
|
||||
case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break;
|
||||
case "pause": $obj.pause(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// public methods
|
||||
slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
|
||||
if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
|
||||
if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) {
|
||||
if (asNav && withSync) {
|
||||
var master = $(vars.asNavFor).data('flexslider');
|
||||
slider.atEnd = target === 0 || target === slider.count - 1;
|
||||
master.flexAnimate(target, true, false, true, fromNav);
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
master.direction = slider.direction;
|
||||
|
||||
if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) {
|
||||
slider.currentItem = target;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
||||
target = Math.floor(target/slider.visible);
|
||||
} else {
|
||||
slider.currentItem = target;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
slider.animating = true;
|
||||
slider.animatingTo = target;
|
||||
// API: before() animation Callback
|
||||
vars.before(slider);
|
||||
|
||||
// SLIDESHOW:
|
||||
if (pause) slider.pause();
|
||||
|
||||
// SYNC:
|
||||
if (slider.syncExists && !fromNav) methods.sync("animate");
|
||||
|
||||
// CONTROLNAV
|
||||
if (vars.controlNav) methods.controlNav.active();
|
||||
|
||||
// !CAROUSEL:
|
||||
// CANDIDATE: slide active class (for add/remove slide)
|
||||
if (!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide');
|
||||
|
||||
// INFINITE LOOP:
|
||||
// CANDIDATE: atEnd
|
||||
slider.atEnd = target === 0 || target === slider.last;
|
||||
|
||||
// DIRECTIONNAV:
|
||||
if (vars.directionNav) methods.directionNav.update();
|
||||
|
||||
if (target === slider.last) {
|
||||
// API: end() of cycle Callback
|
||||
vars.end(slider);
|
||||
// SLIDESHOW && !INFINITE LOOP:
|
||||
if (!vars.animationLoop) slider.pause();
|
||||
}
|
||||
|
||||
// SLIDE:
|
||||
if (!fade) {
|
||||
var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW,
|
||||
margin, slideString, calcNext;
|
||||
|
||||
// INFINITE LOOP / REVERSE:
|
||||
if (carousel) {
|
||||
margin = (vars.itemWidth > slider.w) ? vars.itemMargin * 2 : vars.itemMargin;
|
||||
calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo;
|
||||
slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext;
|
||||
} else if (slider.currentSlide === 0 && target === slider.count - 1 && vars.animationLoop && slider.direction !== "next") {
|
||||
slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0;
|
||||
} else if (slider.currentSlide === slider.last && target === 0 && vars.animationLoop && slider.direction !== "prev") {
|
||||
slideString = (reverse) ? 0 : (slider.count + 1) * dimension;
|
||||
} else {
|
||||
slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension;
|
||||
}
|
||||
slider.setProps(slideString, "", vars.animationSpeed);
|
||||
if (slider.transitions) {
|
||||
if (!vars.animationLoop || !slider.atEnd) {
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
}
|
||||
slider.container.unbind("webkitTransitionEnd transitionend");
|
||||
slider.container.bind("webkitTransitionEnd transitionend", function() {
|
||||
slider.wrapup(dimension);
|
||||
});
|
||||
} else {
|
||||
slider.container.animate(slider.args, vars.animationSpeed, vars.easing, function(){
|
||||
slider.wrapup(dimension);
|
||||
});
|
||||
}
|
||||
} else { // FADE:
|
||||
if (!touch) {
|
||||
slider.slides.eq(slider.currentSlide).fadeOut(vars.animationSpeed, vars.easing);
|
||||
slider.slides.eq(target).fadeIn(vars.animationSpeed, vars.easing, slider.wrapup);
|
||||
} else {
|
||||
slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
|
||||
slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
|
||||
|
||||
slider.slides.unbind("webkitTransitionEnd transitionend");
|
||||
slider.slides.eq(slider.currentSlide).bind("webkitTransitionEnd transitionend", function() {
|
||||
// API: after() animation Callback
|
||||
vars.after(slider);
|
||||
});
|
||||
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
}
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight(vars.animationSpeed);
|
||||
}
|
||||
}
|
||||
slider.wrapup = function(dimension) {
|
||||
// SLIDE:
|
||||
if (!fade && !carousel) {
|
||||
if (slider.currentSlide === 0 && slider.animatingTo === slider.last && vars.animationLoop) {
|
||||
slider.setProps(dimension, "jumpEnd");
|
||||
} else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && vars.animationLoop) {
|
||||
slider.setProps(dimension, "jumpStart");
|
||||
}
|
||||
}
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
// API: after() animation Callback
|
||||
vars.after(slider);
|
||||
}
|
||||
|
||||
// SLIDESHOW:
|
||||
slider.animateSlides = function() {
|
||||
if (!slider.animating) slider.flexAnimate(slider.getTarget("next"));
|
||||
}
|
||||
// SLIDESHOW:
|
||||
slider.pause = function() {
|
||||
clearInterval(slider.animatedSlides);
|
||||
slider.playing = false;
|
||||
// PAUSEPLAY:
|
||||
if (vars.pausePlay) methods.pausePlay.update("play");
|
||||
// SYNC:
|
||||
if (slider.syncExists) methods.sync("pause");
|
||||
}
|
||||
// SLIDESHOW:
|
||||
slider.play = function() {
|
||||
slider.animatedSlides = setInterval(slider.animateSlides, vars.slideshowSpeed);
|
||||
slider.playing = true;
|
||||
// PAUSEPLAY:
|
||||
if (vars.pausePlay) methods.pausePlay.update("pause");
|
||||
// SYNC:
|
||||
if (slider.syncExists) methods.sync("play");
|
||||
}
|
||||
slider.canAdvance = function(target, fromNav) {
|
||||
// ASNAV:
|
||||
var last = (asNav) ? slider.pagingCount - 1 : slider.last;
|
||||
return (fromNav) ? true :
|
||||
(asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true :
|
||||
(asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false :
|
||||
(target === slider.currentSlide && !asNav) ? false :
|
||||
(vars.animationLoop) ? true :
|
||||
(slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false :
|
||||
(slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false :
|
||||
true;
|
||||
}
|
||||
slider.getTarget = function(dir) {
|
||||
slider.direction = dir;
|
||||
if (dir === "next") {
|
||||
return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1;
|
||||
} else {
|
||||
return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// SLIDE:
|
||||
slider.setProps = function(pos, special, dur) {
|
||||
var target = (function() {
|
||||
var posCheck = (pos) ? pos : ((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo,
|
||||
posCalc = (function() {
|
||||
if (carousel) {
|
||||
return (special === "setTouch") ? pos :
|
||||
(reverse && slider.animatingTo === slider.last) ? 0 :
|
||||
(reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
|
||||
(slider.animatingTo === slider.last) ? slider.limit : posCheck;
|
||||
} else {
|
||||
switch (special) {
|
||||
case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos;
|
||||
case "setTouch": return (reverse) ? pos : pos;
|
||||
case "jumpEnd": return (reverse) ? pos : slider.count * pos;
|
||||
case "jumpStart": return (reverse) ? slider.count * pos : pos;
|
||||
default: return pos;
|
||||
}
|
||||
}
|
||||
}());
|
||||
return (posCalc * -1) + "px";
|
||||
}());
|
||||
|
||||
if (slider.transitions) {
|
||||
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)";
|
||||
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
|
||||
slider.container.css("-" + slider.pfx + "-transition-duration", dur);
|
||||
}
|
||||
|
||||
slider.args[slider.prop] = target;
|
||||
if (slider.transitions || dur === undefined) slider.container.css(slider.args);
|
||||
}
|
||||
|
||||
slider.setup = function(type) {
|
||||
// SLIDE:
|
||||
if (!fade) {
|
||||
var sliderOffset, arr;
|
||||
|
||||
if (type === "init") {
|
||||
slider.viewport = $('<div class="' + namespace + 'viewport"></div>').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container);
|
||||
// INFINITE LOOP:
|
||||
slider.cloneCount = 0;
|
||||
slider.cloneOffset = 0;
|
||||
// REVERSE:
|
||||
if (reverse) {
|
||||
arr = $.makeArray(slider.slides).reverse();
|
||||
slider.slides = $(arr);
|
||||
slider.container.empty().append(slider.slides);
|
||||
}
|
||||
}
|
||||
// INFINITE LOOP && !CAROUSEL:
|
||||
if (vars.animationLoop && !carousel) {
|
||||
slider.cloneCount = 2;
|
||||
slider.cloneOffset = 1;
|
||||
// clear out old clones
|
||||
if (type !== "init") slider.container.find('.clone').remove();
|
||||
slider.container.append(slider.slides.first().clone().addClass('clone')).prepend(slider.slides.last().clone().addClass('clone'));
|
||||
}
|
||||
slider.newSlides = $(vars.selector, slider);
|
||||
|
||||
sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset;
|
||||
// VERTICAL:
|
||||
if (vertical && !carousel) {
|
||||
slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%");
|
||||
setTimeout(function(){
|
||||
slider.newSlides.css({"display": "block"});
|
||||
slider.doMath();
|
||||
slider.viewport.height(slider.h);
|
||||
slider.setProps(sliderOffset * slider.h, "init");
|
||||
}, (type === "init") ? 100 : 0);
|
||||
} else {
|
||||
slider.container.width((slider.count + slider.cloneCount) * 200 + "%");
|
||||
slider.setProps(sliderOffset * slider.computedW, "init");
|
||||
setTimeout(function(){
|
||||
slider.doMath();
|
||||
slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"});
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
}, (type === "init") ? 100 : 0);
|
||||
}
|
||||
} else { // FADE:
|
||||
slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});
|
||||
if (type === "init") {
|
||||
if (!touch) {
|
||||
slider.slides.eq(slider.currentSlide).fadeIn(vars.animationSpeed, vars.easing);
|
||||
} else {
|
||||
slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2});
|
||||
}
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
}
|
||||
// !CAROUSEL:
|
||||
// CANDIDATE: active slide
|
||||
if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide");
|
||||
}
|
||||
|
||||
slider.doMath = function() {
|
||||
var slide = slider.slides.first(),
|
||||
slideMargin = vars.itemMargin,
|
||||
minItems = vars.minItems,
|
||||
maxItems = vars.maxItems;
|
||||
|
||||
slider.w = slider.width();
|
||||
slider.h = slide.height();
|
||||
slider.boxPadding = slide.outerWidth() - slide.width();
|
||||
|
||||
// CAROUSEL:
|
||||
if (carousel) {
|
||||
slider.itemT = vars.itemWidth + slideMargin;
|
||||
slider.minW = (minItems) ? minItems * slider.itemT : slider.w;
|
||||
slider.maxW = (maxItems) ? maxItems * slider.itemT : slider.w;
|
||||
slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * minItems))/minItems :
|
||||
(slider.maxW < slider.w) ? (slider.w - (slideMargin * maxItems))/maxItems :
|
||||
(vars.itemWidth > slider.w) ? slider.w : vars.itemWidth;
|
||||
slider.visible = Math.floor(slider.w/(slider.itemW + slideMargin));
|
||||
slider.move = (vars.move > 0 && vars.move < slider.visible ) ? vars.move : slider.visible;
|
||||
slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1);
|
||||
slider.last = slider.pagingCount - 1;
|
||||
slider.limit = (slider.pagingCount === 1) ? 0 :
|
||||
(vars.itemWidth > slider.w) ? ((slider.itemW + (slideMargin * 2)) * slider.count) - slider.w - slideMargin : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin;
|
||||
} else {
|
||||
slider.itemW = slider.w;
|
||||
slider.pagingCount = slider.count;
|
||||
slider.last = slider.count - 1;
|
||||
}
|
||||
slider.computedW = slider.itemW - slider.boxPadding;
|
||||
}
|
||||
|
||||
slider.update = function(pos, action) {
|
||||
slider.doMath();
|
||||
|
||||
// update currentSlide and slider.animatingTo if necessary
|
||||
if (!carousel) {
|
||||
if (pos < slider.currentSlide) {
|
||||
slider.currentSlide += 1;
|
||||
} else if (pos <= slider.currentSlide && pos !== 0) {
|
||||
slider.currentSlide -= 1;
|
||||
}
|
||||
slider.animatingTo = slider.currentSlide;
|
||||
}
|
||||
|
||||
// update controlNav
|
||||
if (vars.controlNav && !slider.manualControls) {
|
||||
if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) {
|
||||
methods.controlNav.update("add");
|
||||
} else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) {
|
||||
if (carousel && slider.currentSlide > slider.last) {
|
||||
slider.currentSlide -= 1;
|
||||
slider.animatingTo -= 1;
|
||||
}
|
||||
methods.controlNav.update("remove", slider.last);
|
||||
}
|
||||
}
|
||||
// update directionNav
|
||||
if (vars.directionNav) methods.directionNav.update();
|
||||
|
||||
}
|
||||
|
||||
slider.addSlide = function(obj, pos) {
|
||||
var $obj = $(obj);
|
||||
|
||||
slider.count += 1;
|
||||
slider.last = slider.count - 1;
|
||||
|
||||
// append new slide
|
||||
if (vertical && reverse) {
|
||||
(pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj);
|
||||
} else {
|
||||
(pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj);
|
||||
}
|
||||
|
||||
// update currentSlide, animatingTo, controlNav, and directionNav
|
||||
slider.update(pos, "add");
|
||||
|
||||
// update slider.slides
|
||||
slider.slides = $(vars.selector + ':not(.clone)', slider);
|
||||
// re-setup the slider to accomdate new slide
|
||||
slider.setup();
|
||||
|
||||
//FlexSlider: added() Callback
|
||||
vars.added(slider);
|
||||
}
|
||||
slider.removeSlide = function(obj) {
|
||||
var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj;
|
||||
|
||||
// update count
|
||||
slider.count -= 1;
|
||||
slider.last = slider.count - 1;
|
||||
|
||||
// remove slide
|
||||
if (isNaN(obj)) {
|
||||
$(obj, slider.slides).remove();
|
||||
} else {
|
||||
(vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove();
|
||||
}
|
||||
|
||||
// update currentSlide, animatingTo, controlNav, and directionNav
|
||||
slider.doMath();
|
||||
slider.update(pos, "remove");
|
||||
|
||||
// update slider.slides
|
||||
slider.slides = $(vars.selector + ':not(.clone)', slider);
|
||||
// re-setup the slider to accomdate new slide
|
||||
slider.setup();
|
||||
|
||||
// FlexSlider: removed() Callback
|
||||
vars.removed(slider);
|
||||
}
|
||||
|
||||
//FlexSlider: Initialize
|
||||
methods.init();
|
||||
}
|
||||
|
||||
//FlexSlider: Default Settings
|
||||
$.flexslider.defaults = {
|
||||
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
|
||||
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
|
||||
animation: "fade", //String: Select your animation type, "fade" or "slide"
|
||||
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
|
||||
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
|
||||
reverse: false, //{NEW} Boolean: Reverse the animation direction
|
||||
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
|
||||
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
|
||||
startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
|
||||
slideshow: true, //Boolean: Animate slider automatically
|
||||
slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds
|
||||
animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds
|
||||
initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds
|
||||
randomize: false, //Boolean: Randomize slide order
|
||||
|
||||
// Usability features
|
||||
pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
|
||||
pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
|
||||
useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available
|
||||
touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
|
||||
video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
|
||||
|
||||
// Primary Controls
|
||||
controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
|
||||
directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false)
|
||||
prevText: "Previous", //String: Set the text for the "previous" directionNav item
|
||||
nextText: "Next", //String: Set the text for the "next" directionNav item
|
||||
|
||||
// Secondary Navigation
|
||||
keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys
|
||||
multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
|
||||
mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
|
||||
pausePlay: false, //Boolean: Create pause/play dynamic element
|
||||
pauseText: "Pause", //String: Set the text for the "pause" pausePlay item
|
||||
playText: "Play", //String: Set the text for the "play" pausePlay item
|
||||
|
||||
// Special properties
|
||||
controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found.
|
||||
manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
|
||||
sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
|
||||
asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
|
||||
|
||||
// Carousel Options
|
||||
itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
|
||||
itemMargin: 0, //{NEW} Integer: Margin between carousel items.
|
||||
minItems: 0, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
|
||||
maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
|
||||
move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
|
||||
|
||||
// Callback API
|
||||
start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
|
||||
before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation
|
||||
after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
|
||||
end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
|
||||
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
|
||||
removed: function(){} //{NEW} Callback: function(slider) - Fires after a slide is removed
|
||||
}
|
||||
|
||||
|
||||
//FlexSlider: Plugin Function
|
||||
$.fn.flexslider = function(options) {
|
||||
if (options === undefined) options = {};
|
||||
|
||||
if (typeof options === "object") {
|
||||
return this.each(function() {
|
||||
var $this = $(this),
|
||||
selector = (options.selector) ? options.selector : ".slides > li",
|
||||
$slides = $this.find(selector);
|
||||
|
||||
if ($slides.length === 1) {
|
||||
$slides.fadeIn(400);
|
||||
if (options.start) options.start($this);
|
||||
} else if ($this.data('flexslider') == undefined) {
|
||||
new $.flexslider(this, options);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Helper strings to quickly perform functions on the slider
|
||||
var $slider = $(this).data('flexslider');
|
||||
switch (options) {
|
||||
case "play": $slider.play(); break;
|
||||
case "pause": $slider.pause(); break;
|
||||
case "next": $slider.flexAnimate($slider.getTarget("next"), true); break;
|
||||
case "prev":
|
||||
case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break;
|
||||
default: if (typeof options === "number") $slider.flexAnimate(options, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
43
js/jquery.flexslider.min.js
vendored
Normal file
43
js/jquery.flexslider.min.js
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* jQuery FlexSlider v2.1
|
||||
* http://www.woothemes.com/flexslider/
|
||||
*
|
||||
* Copyright 2012 WooThemes
|
||||
* Free to use under the GPLv2 license.
|
||||
* http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributing author: Tyler Smith (@mbmufffin)
|
||||
*/
|
||||
(function(d){d.flexslider=function(j,l){var a=d(j),c=d.extend({},d.flexslider.defaults,l),e=c.namespace,q="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,u=q?"touchend":"click",m="vertical"===c.direction,n=c.reverse,h=0<c.itemWidth,s="fade"===c.animation,t=""!==c.asNavFor,f={};d.data(j,"flexslider",a);f={init:function(){a.animating=!1;a.currentSlide=c.startAt;a.animatingTo=a.currentSlide;a.atEnd=0===a.currentSlide||a.currentSlide===a.last;a.containerSelector=c.selector.substr(0,
|
||||
c.selector.search(" "));a.slides=d(c.selector,a);a.container=d(a.containerSelector,a);a.count=a.slides.length;a.syncExists=0<d(c.sync).length;"slide"===c.animation&&(c.animation="swing");a.prop=m?"top":"marginLeft";a.args={};a.manualPause=!1;var b=a,g;if(g=!c.video)if(g=!s)if(g=c.useCSS)a:{g=document.createElement("div");var p=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"],e;for(e in p)if(void 0!==g.style[p[e]]){a.pfx=p[e].replace("Perspective","").toLowerCase();
|
||||
a.prop="-"+a.pfx+"-transform";g=!0;break a}g=!1}b.transitions=g;""!==c.controlsContainer&&(a.controlsContainer=0<d(c.controlsContainer).length&&d(c.controlsContainer));""!==c.manualControls&&(a.manualControls=0<d(c.manualControls).length&&d(c.manualControls));c.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-0.5}),a.container.empty().append(a.slides));a.doMath();t&&f.asNav.setup();a.setup("init");c.controlNav&&f.controlNav.setup();c.directionNav&&f.directionNav.setup();c.keyboard&&
|
||||
(1===d(a.containerSelector).length||c.multipleKeyboard)&&d(document).bind("keyup",function(b){b=b.keyCode;if(!a.animating&&(39===b||37===b))b=39===b?a.getTarget("next"):37===b?a.getTarget("prev"):!1,a.flexAnimate(b,c.pauseOnAction)});c.mousewheel&&a.bind("mousewheel",function(b,g){b.preventDefault();var d=0>g?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(d,c.pauseOnAction)});c.pausePlay&&f.pausePlay.setup();c.slideshow&&(c.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},
|
||||
function(){!a.manualPause&&!a.manualPlay&&a.play()}),0<c.initDelay?setTimeout(a.play,c.initDelay):a.play());q&&c.touch&&f.touch();(!s||s&&c.smoothHeight)&&d(window).bind("resize focus",f.resize);setTimeout(function(){c.start(a)},200)},asNav:{setup:function(){a.asNav=!0;a.animatingTo=Math.floor(a.currentSlide/a.move);a.currentItem=a.currentSlide;a.slides.removeClass(e+"active-slide").eq(a.currentItem).addClass(e+"active-slide");a.slides.click(function(b){b.preventDefault();b=d(this);var g=b.index();
|
||||
!d(c.asNavFor).data("flexslider").animating&&!b.hasClass("active")&&(a.direction=a.currentItem<g?"next":"prev",a.flexAnimate(g,c.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var b=1,g;a.controlNavScaffold=d('<ol class="'+e+"control-nav "+e+("thumbnails"===c.controlNav?"control-thumbs":"control-paging")+'"></ol>');if(1<a.pagingCount)for(var p=0;p<a.pagingCount;p++)g="thumbnails"===c.controlNav?
|
||||
'<img src="'+a.slides.eq(p).attr("data-thumb")+'"/>':"<a>"+b+"</a>",a.controlNavScaffold.append("<li>"+g+"</li>"),b++;a.controlsContainer?d(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img",u,function(b){b.preventDefault();b=d(this);var g=a.controlNav.index(b);b.hasClass(e+"active")||(a.direction=g>a.currentSlide?"next":"prev",a.flexAnimate(g,c.pauseOnAction))});q&&a.controlNavScaffold.delegate("a",
|
||||
"click touchstart",function(a){a.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.live(u,function(b){b.preventDefault();b=d(this);var g=a.controlNav.index(b);b.hasClass(e+"active")||(g>a.currentSlide?a.direction="next":a.direction="prev",a.flexAnimate(g,c.pauseOnAction))});q&&a.controlNav.live("click touchstart",function(a){a.preventDefault()})},set:function(){a.controlNav=d("."+e+"control-nav li "+("thumbnails"===c.controlNav?"img":"a"),
|
||||
a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(e+"active").eq(a.animatingTo).addClass(e+"active")},update:function(b,c){1<a.pagingCount&&"add"===b?a.controlNavScaffold.append(d("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(c).closest("li").remove();f.controlNav.set();1<a.pagingCount&&a.pagingCount!==a.controlNav.length?a.update(c,b):f.controlNav.active()}},directionNav:{setup:function(){var b=d('<ul class="'+
|
||||
e+'direction-nav"><li><a class="'+e+'prev" href="#">'+c.prevText+'</a></li><li><a class="'+e+'next" href="#">'+c.nextText+"</a></li></ul>");a.controlsContainer?(d(a.controlsContainer).append(b),a.directionNav=d("."+e+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav=d("."+e+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind(u,function(b){b.preventDefault();b=d(this).hasClass(e+"next")?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(b,c.pauseOnAction)});
|
||||
q&&a.directionNav.bind("click touchstart",function(a){a.preventDefault()})},update:function(){var b=e+"disabled";1===a.pagingCount?a.directionNav.addClass(b):c.animationLoop?a.directionNav.removeClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+e+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+e+"next").addClass(b):a.directionNav.removeClass(b)}},pausePlay:{setup:function(){var b=d('<div class="'+e+'pauseplay"><a></a></div>');a.controlsContainer?
|
||||
(a.controlsContainer.append(b),a.pausePlay=d("."+e+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=d("."+e+"pauseplay a",a));f.pausePlay.update(c.slideshow?e+"pause":e+"play");a.pausePlay.bind(u,function(b){b.preventDefault();d(this).hasClass(e+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())});q&&a.pausePlay.bind("click touchstart",function(a){a.preventDefault()})},update:function(b){"play"===b?a.pausePlay.removeClass(e+"pause").addClass(e+
|
||||
"play").text(c.playText):a.pausePlay.removeClass(e+"play").addClass(e+"pause").text(c.pauseText)}},touch:function(){function b(b){k=m?d-b.touches[0].pageY:d-b.touches[0].pageX;q=m?Math.abs(k)<Math.abs(b.touches[0].pageX-e):Math.abs(k)<Math.abs(b.touches[0].pageY-e);if(!q||500<Number(new Date)-l)b.preventDefault(),!s&&a.transitions&&(c.animationLoop||(k/=0===a.currentSlide&&0>k||a.currentSlide===a.last&&0<k?Math.abs(k)/r+2:1),a.setProps(f+k,"setTouch"))}function g(){j.removeEventListener("touchmove",
|
||||
b,!1);if(a.animatingTo===a.currentSlide&&!q&&null!==k){var h=n?-k:k,m=0<h?a.getTarget("next"):a.getTarget("prev");a.canAdvance(m)&&(550>Number(new Date)-l&&50<Math.abs(h)||Math.abs(h)>r/2)?a.flexAnimate(m,c.pauseOnAction):s||a.flexAnimate(a.currentSlide,c.pauseOnAction,!0)}j.removeEventListener("touchend",g,!1);f=k=e=d=null}var d,e,f,r,k,l,q=!1;j.addEventListener("touchstart",function(k){a.animating?k.preventDefault():1===k.touches.length&&(a.pause(),r=m?a.h:a.w,l=Number(new Date),f=h&&n&&a.animatingTo===
|
||||
a.last?0:h&&n?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:h&&a.currentSlide===a.last?a.limit:h?(a.itemW+c.itemMargin)*a.move*a.currentSlide:n?(a.last-a.currentSlide+a.cloneOffset)*r:(a.currentSlide+a.cloneOffset)*r,d=m?k.touches[0].pageY:k.touches[0].pageX,e=m?k.touches[0].pageX:k.touches[0].pageY,j.addEventListener("touchmove",b,!1),j.addEventListener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(h||a.doMath(),s?f.smoothHeight():h?(a.slides.width(a.computedW),
|
||||
a.update(a.pagingCount),a.setProps()):m?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(c.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(b){if(!m||s){var c=s?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingTo).height()},b):c.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingTo;switch(b){case "animate":g.flexAnimate(e,c.pauseOnAction,!1,!0);break;case "play":!g.playing&&
|
||||
!g.asNav&&g.play();break;case "pause":g.pause()}}};a.flexAnimate=function(b,g,p,j,l){t&&1===a.pagingCount&&(a.direction=a.currentItem<b?"next":"prev");if(!a.animating&&(a.canAdvance(b,l)||p)&&a.is(":visible")){if(t&&j)if(p=d(c.asNavFor).data("flexslider"),a.atEnd=0===b||b===a.count-1,p.flexAnimate(b,!0,!1,!0,l),a.direction=a.currentItem<b?"next":"prev",p.direction=a.direction,Math.ceil((b+1)/a.visible)-1!==a.currentSlide&&0!==b)a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+
|
||||
"active-slide"),b=Math.floor(b/a.visible);else return a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide"),!1;a.animating=!0;a.animatingTo=b;c.before(a);g&&a.pause();a.syncExists&&!l&&f.sync("animate");c.controlNav&&f.controlNav.active();h||a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide");a.atEnd=0===b||b===a.last;c.directionNav&&f.directionNav.update();b===a.last&&(c.end(a),c.animationLoop||a.pause());if(s)q?(a.slides.eq(a.currentSlide).css({opacity:0,
|
||||
zIndex:1}),a.slides.eq(b).css({opacity:1,zIndex:2}),a.slides.unbind("webkitTransitionEnd transitionend"),a.slides.eq(a.currentSlide).bind("webkitTransitionEnd transitionend",function(){c.after(a)}),a.animating=!1,a.currentSlide=a.animatingTo):(a.slides.eq(a.currentSlide).fadeOut(c.animationSpeed,c.easing),a.slides.eq(b).fadeIn(c.animationSpeed,c.easing,a.wrapup));else{var r=m?a.slides.filter(":first").height():a.computedW;h?(b=c.itemWidth>a.w?2*c.itemMargin:c.itemMargin,b=(a.itemW+b)*a.move*a.animatingTo,
|
||||
b=b>a.limit&&1!==a.visible?a.limit:b):b=0===a.currentSlide&&b===a.count-1&&c.animationLoop&&"next"!==a.direction?n?(a.count+a.cloneOffset)*r:0:a.currentSlide===a.last&&0===b&&c.animationLoop&&"prev"!==a.direction?n?0:(a.count+1)*r:n?(a.count-1-b+a.cloneOffset)*r:(b+a.cloneOffset)*r;a.setProps(b,"",c.animationSpeed);if(a.transitions){if(!c.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",
|
||||
function(){a.wrapup(r)})}else a.container.animate(a.args,c.animationSpeed,c.easing,function(){a.wrapup(r)})}c.smoothHeight&&f.smoothHeight(c.animationSpeed)}};a.wrapup=function(b){!s&&!h&&(0===a.currentSlide&&a.animatingTo===a.last&&c.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide===a.last&&(0===a.animatingTo&&c.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;c.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=
|
||||
function(){clearInterval(a.animatedSlides);a.playing=!1;c.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides=setInterval(a.animateSlides,c.slideshowSpeed);a.playing=!0;c.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b,g){var d=t?a.pagingCount-1:a.last;return g?!0:t&&a.currentItem===a.count-1&&0===b&&"prev"===a.direction?!0:t&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&
|
||||
!t?!1:c.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===d&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===d&&0===b&&"next"===a.direction?!1:!0};a.getTarget=function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1};a.setProps=function(b,g,d){var e,f=b?b:(a.itemW+c.itemMargin)*a.move*a.animatingTo;e=-1*function(){if(h)return"setTouch"===g?b:n&&a.animatingTo===a.last?0:n?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:a.animatingTo===
|
||||
a.last?a.limit:f;switch(g){case "setTotal":return n?(a.count-1-a.currentSlide+a.cloneOffset)*b:(a.currentSlide+a.cloneOffset)*b;case "setTouch":return b;case "jumpEnd":return n?b:a.count*b;case "jumpStart":return n?a.count*b:b;default:return b}}()+"px";a.transitions&&(e=m?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",d=void 0!==d?d/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",d));a.args[a.prop]=e;(a.transitions||void 0===d)&&a.container.css(a.args)};a.setup=function(b){if(s)a.slides.css({width:"100%",
|
||||
"float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&(q?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+c.animationSpeed/1E3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed,c.easing)),c.smoothHeight&&f.smoothHeight();else{var g,p;"init"===b&&(a.viewport=d('<div class="'+e+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=
|
||||
0,n&&(p=d.makeArray(a.slides).reverse(),a.slides=d(p),a.container.empty().append(a.slides)));c.animationLoop&&!h&&(a.cloneCount=2,a.cloneOffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));a.newSlides=d(c.selector,a);g=n?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;m&&!h?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),
|
||||
setTimeout(function(){a.newSlides.css({display:"block"});a.doMath();a.viewport.height(a.h);a.setProps(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(g*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",display:"block"});c.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}h||a.slides.removeClass(e+"active-slide").eq(a.currentSlide).addClass(e+"active-slide")};a.doMath=function(){var b=a.slides.first(),
|
||||
d=c.itemMargin,e=c.minItems,f=c.maxItems;a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();h?(a.itemT=c.itemWidth+d,a.minW=e?e*a.itemT:a.w,a.maxW=f?f*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-d*e)/e:a.maxW<a.w?(a.w-d*f)/f:c.itemWidth>a.w?a.w:c.itemWidth,a.visible=Math.floor(a.w/(a.itemW+d)),a.move=0<c.move&&c.move<a.visible?c.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:c.itemWidth>a.w?(a.itemW+2*d)*a.count-a.w-
|
||||
d:(a.itemW+d)*a.count-a.w-d):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,d){a.doMath();h||(b<a.currentSlide?a.currentSlide+=1:b<=a.currentSlide&&0!==b&&(a.currentSlide-=1),a.animatingTo=a.currentSlide);if(c.controlNav&&!a.manualControls)if("add"===d&&!h||a.pagingCount>a.controlNav.length)f.controlNav.update("add");else if("remove"===d&&!h||a.pagingCount<a.controlNav.length)h&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),
|
||||
f.controlNav.update("remove",a.last);c.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;m&&n?void 0!==e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.added(a)};a.removeSlide=function(b){var e=isNaN(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?d(b,a.slides).remove():m&&n?a.slides.eq(a.last).remove():
|
||||
a.slides.eq(b).remove();a.doMath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",
|
||||
keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};d.fn.flexslider=function(j){void 0===j&&(j={});if("object"===typeof j)return this.each(function(){var a=d(this),c=a.find(j.selector?j.selector:".slides > li");1===c.length?(c.fadeIn(400),
|
||||
j.start&&j.start(a)):void 0==a.data("flexslider")&&new d.flexslider(this,j)});var l=d(this).data("flexslider");switch(j){case "play":l.play();break;case "pause":l.pause();break;case "next":l.flexAnimate(l.getTarget("next"),!0);break;case "prev":case "previous":l.flexAnimate(l.getTarget("prev"),!0);break;default:"number"===typeof j&&l.flexAnimate(j,!0)}}})(jQuery);
|
1512
js/owl.carousel.js
Normal file
1512
js/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load diff
47
js/owl.carousel.min.js
vendored
Normal file
47
js/owl.carousel.min.js
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
"function"!==typeof Object.create&&(Object.create=function(f){function g(){}g.prototype=f;return new g});
|
||||
(function(f,g,k){var l={init:function(a,b){this.$elem=f(b);this.options=f.extend({},f.fn.owlCarousel.options,this.$elem.data(),a);this.userOptions=a;this.loadContent()},loadContent:function(){function a(a){var d,e="";if("function"===typeof b.options.jsonSuccess)b.options.jsonSuccess.apply(this,[a]);else{for(d in a.owl)a.owl.hasOwnProperty(d)&&(e+=a.owl[d].item);b.$elem.html(e)}b.logIn()}var b=this,e;"function"===typeof b.options.beforeInit&&b.options.beforeInit.apply(this,[b.$elem]);"string"===typeof b.options.jsonPath?
|
||||
(e=b.options.jsonPath,f.getJSON(e,a)):b.logIn()},logIn:function(){this.$elem.data("owl-originalStyles",this.$elem.attr("style"));this.$elem.data("owl-originalClasses",this.$elem.attr("class"));this.$elem.css({opacity:0});this.orignalItems=this.options.items;this.checkBrowser();this.wrapperWidth=0;this.checkVisible=null;this.setVars()},setVars:function(){if(0===this.$elem.children().length)return!1;this.baseClass();this.eventTypes();this.$userItems=this.$elem.children();this.itemsAmount=this.$userItems.length;
|
||||
this.wrapItems();this.$owlItems=this.$elem.find(".owl-item");this.$owlWrapper=this.$elem.find(".owl-wrapper");this.playDirection="next";this.prevItem=0;this.prevArr=[0];this.currentItem=0;this.customEvents();this.onStartup()},onStartup:function(){this.updateItems();this.calculateAll();this.buildControls();this.updateControls();this.response();this.moveEvents();this.stopOnHover();this.owlStatus();!1!==this.options.transitionStyle&&this.transitionTypes(this.options.transitionStyle);!0===this.options.autoPlay&&
|
||||
(this.options.autoPlay=5E3);this.play();this.$elem.find(".owl-wrapper").css("display","block");this.$elem.is(":visible")?this.$elem.css("opacity",1):this.watchVisibility();this.onstartup=!1;this.eachMoveUpdate();"function"===typeof this.options.afterInit&&this.options.afterInit.apply(this,[this.$elem])},eachMoveUpdate:function(){!0===this.options.lazyLoad&&this.lazyLoad();!0===this.options.autoHeight&&this.autoHeight();this.onVisibleItems();"function"===typeof this.options.afterAction&&this.options.afterAction.apply(this,
|
||||
[this.$elem])},updateVars:function(){"function"===typeof this.options.beforeUpdate&&this.options.beforeUpdate.apply(this,[this.$elem]);this.watchVisibility();this.updateItems();this.calculateAll();this.updatePosition();this.updateControls();this.eachMoveUpdate();"function"===typeof this.options.afterUpdate&&this.options.afterUpdate.apply(this,[this.$elem])},reload:function(){var a=this;g.setTimeout(function(){a.updateVars()},0)},watchVisibility:function(){var a=this;if(!1===a.$elem.is(":visible"))a.$elem.css({opacity:0}),
|
||||
g.clearInterval(a.autoPlayInterval),g.clearInterval(a.checkVisible);else return!1;a.checkVisible=g.setInterval(function(){a.$elem.is(":visible")&&(a.reload(),a.$elem.animate({opacity:1},200),g.clearInterval(a.checkVisible))},500)},wrapItems:function(){this.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>');this.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');this.wrapperOuter=this.$elem.find(".owl-wrapper-outer");this.$elem.css("display","block")},
|
||||
baseClass:function(){var a=this.$elem.hasClass(this.options.baseClass),b=this.$elem.hasClass(this.options.theme);a||this.$elem.addClass(this.options.baseClass);b||this.$elem.addClass(this.options.theme)},updateItems:function(){var a,b;if(!1===this.options.responsive)return!1;if(!0===this.options.singleItem)return this.options.items=this.orignalItems=1,this.options.itemsCustom=!1,this.options.itemsDesktop=!1,this.options.itemsDesktopSmall=!1,this.options.itemsTablet=!1,this.options.itemsTabletSmall=
|
||||
!1,this.options.itemsMobile=!1;a=f(this.options.responsiveBaseWidth).width();a>(this.options.itemsDesktop[0]||this.orignalItems)&&(this.options.items=this.orignalItems);if(!1!==this.options.itemsCustom)for(this.options.itemsCustom.sort(function(a,b){return a[0]-b[0]}),b=0;b<this.options.itemsCustom.length;b+=1)this.options.itemsCustom[b][0]<=a&&(this.options.items=this.options.itemsCustom[b][1]);else a<=this.options.itemsDesktop[0]&&!1!==this.options.itemsDesktop&&(this.options.items=this.options.itemsDesktop[1]),
|
||||
a<=this.options.itemsDesktopSmall[0]&&!1!==this.options.itemsDesktopSmall&&(this.options.items=this.options.itemsDesktopSmall[1]),a<=this.options.itemsTablet[0]&&!1!==this.options.itemsTablet&&(this.options.items=this.options.itemsTablet[1]),a<=this.options.itemsTabletSmall[0]&&!1!==this.options.itemsTabletSmall&&(this.options.items=this.options.itemsTabletSmall[1]),a<=this.options.itemsMobile[0]&&!1!==this.options.itemsMobile&&(this.options.items=this.options.itemsMobile[1]);this.options.items>this.itemsAmount&&
|
||||
!0===this.options.itemsScaleUp&&(this.options.items=this.itemsAmount)},response:function(){var a=this,b,e;if(!0!==a.options.responsive)return!1;e=f(g).width();a.resizer=function(){f(g).width()!==e&&(!1!==a.options.autoPlay&&g.clearInterval(a.autoPlayInterval),g.clearTimeout(b),b=g.setTimeout(function(){e=f(g).width();a.updateVars()},a.options.responsiveRefreshRate))};f(g).resize(a.resizer)},updatePosition:function(){this.jumpTo(this.currentItem);!1!==this.options.autoPlay&&this.checkAp()},appendItemsSizes:function(){var a=
|
||||
this,b=0,e=a.itemsAmount-a.options.items;a.$owlItems.each(function(c){var d=f(this);d.css({width:a.itemWidth}).data("owl-item",Number(c));if(0===c%a.options.items||c===e)c>e||(b+=1);d.data("owl-roundPages",b)})},appendWrapperSizes:function(){this.$owlWrapper.css({width:this.$owlItems.length*this.itemWidth*2,left:0});this.appendItemsSizes()},calculateAll:function(){this.calculateWidth();this.appendWrapperSizes();this.loops();this.max()},calculateWidth:function(){this.itemWidth=Math.round(this.$elem.width()/
|
||||
this.options.items)},max:function(){var a=-1*(this.itemsAmount*this.itemWidth-this.options.items*this.itemWidth);this.options.items>this.itemsAmount?this.maximumPixels=a=this.maximumItem=0:(this.maximumItem=this.itemsAmount-this.options.items,this.maximumPixels=a);return a},min:function(){return 0},loops:function(){var a=0,b=0,e,c;this.positionsInArray=[0];this.pagesInArray=[];for(e=0;e<this.itemsAmount;e+=1)b+=this.itemWidth,this.positionsInArray.push(-b),!0===this.options.scrollPerPage&&(c=f(this.$owlItems[e]),
|
||||
c=c.data("owl-roundPages"),c!==a&&(this.pagesInArray[a]=this.positionsInArray[e],a=c))},buildControls:function(){if(!0===this.options.navigation||!0===this.options.pagination)this.owlControls=f('<div class="owl-controls"/>').toggleClass("clickable",!this.browser.isTouch).appendTo(this.$elem);!0===this.options.pagination&&this.buildPagination();!0===this.options.navigation&&this.buildButtons()},buildButtons:function(){var a=this,b=f('<div class="owl-buttons"/>');a.owlControls.append(b);a.buttonPrev=
|
||||
f("<div/>",{"class":"owl-prev",html:a.options.navigationText[0]||""});a.buttonNext=f("<div/>",{"class":"owl-next",html:a.options.navigationText[1]||""});b.append(a.buttonPrev).append(a.buttonNext);b.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(a){a.preventDefault()});b.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(b){b.preventDefault();f(this).hasClass("owl-next")?a.next():a.prev()})},buildPagination:function(){var a=this;a.paginationWrapper=
|
||||
f('<div class="owl-pagination"/>');a.owlControls.append(a.paginationWrapper);a.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(b){b.preventDefault();Number(f(this).data("owl-page"))!==a.currentItem&&a.goTo(Number(f(this).data("owl-page")),!0)})},updatePagination:function(){var a,b,e,c,d,g;if(!1===this.options.pagination)return!1;this.paginationWrapper.html("");a=0;b=this.itemsAmount-this.itemsAmount%this.options.items;for(c=0;c<this.itemsAmount;c+=1)0===c%this.options.items&&
|
||||
(a+=1,b===c&&(e=this.itemsAmount-this.options.items),d=f("<div/>",{"class":"owl-page"}),g=f("<span></span>",{text:!0===this.options.paginationNumbers?a:"","class":!0===this.options.paginationNumbers?"owl-numbers":""}),d.append(g),d.data("owl-page",b===c?e:c),d.data("owl-roundPages",a),this.paginationWrapper.append(d));this.checkPagination()},checkPagination:function(){var a=this;if(!1===a.options.pagination)return!1;a.paginationWrapper.find(".owl-page").each(function(){f(this).data("owl-roundPages")===
|
||||
f(a.$owlItems[a.currentItem]).data("owl-roundPages")&&(a.paginationWrapper.find(".owl-page").removeClass("active"),f(this).addClass("active"))})},checkNavigation:function(){if(!1===this.options.navigation)return!1;!1===this.options.rewindNav&&(0===this.currentItem&&0===this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.addClass("disabled")):0===this.currentItem&&0!==this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.removeClass("disabled")):this.currentItem===
|
||||
this.maximumItem?(this.buttonPrev.removeClass("disabled"),this.buttonNext.addClass("disabled")):0!==this.currentItem&&this.currentItem!==this.maximumItem&&(this.buttonPrev.removeClass("disabled"),this.buttonNext.removeClass("disabled")))},updateControls:function(){this.updatePagination();this.checkNavigation();this.owlControls&&(this.options.items>=this.itemsAmount?this.owlControls.hide():this.owlControls.show())},destroyControls:function(){this.owlControls&&this.owlControls.remove()},next:function(a){if(this.isTransition)return!1;
|
||||
this.currentItem+=!0===this.options.scrollPerPage?this.options.items:1;if(this.currentItem>this.maximumItem+(!0===this.options.scrollPerPage?this.options.items-1:0))if(!0===this.options.rewindNav)this.currentItem=0,a="rewind";else return this.currentItem=this.maximumItem,!1;this.goTo(this.currentItem,a)},prev:function(a){if(this.isTransition)return!1;this.currentItem=!0===this.options.scrollPerPage&&0<this.currentItem&&this.currentItem<this.options.items?0:this.currentItem-(!0===this.options.scrollPerPage?
|
||||
this.options.items:1);if(0>this.currentItem)if(!0===this.options.rewindNav)this.currentItem=this.maximumItem,a="rewind";else return this.currentItem=0,!1;this.goTo(this.currentItem,a)},goTo:function(a,b,e){var c=this;if(c.isTransition)return!1;"function"===typeof c.options.beforeMove&&c.options.beforeMove.apply(this,[c.$elem]);a>=c.maximumItem?a=c.maximumItem:0>=a&&(a=0);c.currentItem=c.owl.currentItem=a;if(!1!==c.options.transitionStyle&&"drag"!==e&&1===c.options.items&&!0===c.browser.support3d)return c.swapSpeed(0),
|
||||
!0===c.browser.support3d?c.transition3d(c.positionsInArray[a]):c.css2slide(c.positionsInArray[a],1),c.afterGo(),c.singleItemTransition(),!1;a=c.positionsInArray[a];!0===c.browser.support3d?(c.isCss3Finish=!1,!0===b?(c.swapSpeed("paginationSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},c.options.paginationSpeed)):"rewind"===b?(c.swapSpeed(c.options.rewindSpeed),g.setTimeout(function(){c.isCss3Finish=!0},c.options.rewindSpeed)):(c.swapSpeed("slideSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},
|
||||
c.options.slideSpeed)),c.transition3d(a)):!0===b?c.css2slide(a,c.options.paginationSpeed):"rewind"===b?c.css2slide(a,c.options.rewindSpeed):c.css2slide(a,c.options.slideSpeed);c.afterGo()},jumpTo:function(a){"function"===typeof this.options.beforeMove&&this.options.beforeMove.apply(this,[this.$elem]);a>=this.maximumItem||-1===a?a=this.maximumItem:0>=a&&(a=0);this.swapSpeed(0);!0===this.browser.support3d?this.transition3d(this.positionsInArray[a]):this.css2slide(this.positionsInArray[a],1);this.currentItem=
|
||||
this.owl.currentItem=a;this.afterGo()},afterGo:function(){this.prevArr.push(this.currentItem);this.prevItem=this.owl.prevItem=this.prevArr[this.prevArr.length-2];this.prevArr.shift(0);this.prevItem!==this.currentItem&&(this.checkPagination(),this.checkNavigation(),this.eachMoveUpdate(),!1!==this.options.autoPlay&&this.checkAp());"function"===typeof this.options.afterMove&&this.prevItem!==this.currentItem&&this.options.afterMove.apply(this,[this.$elem])},stop:function(){this.apStatus="stop";g.clearInterval(this.autoPlayInterval)},
|
||||
checkAp:function(){"stop"!==this.apStatus&&this.play()},play:function(){var a=this;a.apStatus="play";if(!1===a.options.autoPlay)return!1;g.clearInterval(a.autoPlayInterval);a.autoPlayInterval=g.setInterval(function(){a.next(!0)},a.options.autoPlay)},swapSpeed:function(a){"slideSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.slideSpeed)):"paginationSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.paginationSpeed)):"string"!==typeof a&&this.$owlWrapper.css(this.addCssSpeed(a))},
|
||||
addCssSpeed:function(a){return{"-webkit-transition":"all "+a+"ms ease","-moz-transition":"all "+a+"ms ease","-o-transition":"all "+a+"ms ease",transition:"all "+a+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(a){return{"-webkit-transform":"translate3d("+a+"px, 0px, 0px)","-moz-transform":"translate3d("+a+"px, 0px, 0px)","-o-transform":"translate3d("+a+"px, 0px, 0px)","-ms-transform":"translate3d("+
|
||||
a+"px, 0px, 0px)",transform:"translate3d("+a+"px, 0px,0px)"}},transition3d:function(a){this.$owlWrapper.css(this.doTranslate(a))},css2move:function(a){this.$owlWrapper.css({left:a})},css2slide:function(a,b){var e=this;e.isCssFinish=!1;e.$owlWrapper.stop(!0,!0).animate({left:a},{duration:b||e.options.slideSpeed,complete:function(){e.isCssFinish=!0}})},checkBrowser:function(){var a=k.createElement("div");a.style.cssText=" -moz-transform:translate3d(0px, 0px, 0px); -ms-transform:translate3d(0px, 0px, 0px); -o-transform:translate3d(0px, 0px, 0px); -webkit-transform:translate3d(0px, 0px, 0px); transform:translate3d(0px, 0px, 0px)";
|
||||
a=a.style.cssText.match(/translate3d\(0px, 0px, 0px\)/g);this.browser={support3d:null!==a&&1===a.length,isTouch:"ontouchstart"in g||g.navigator.msMaxTouchPoints}},moveEvents:function(){if(!1!==this.options.mouseDrag||!1!==this.options.touchDrag)this.gestures(),this.disabledEvents()},eventTypes:function(){var a=["s","e","x"];this.ev_types={};!0===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:
|
||||
!1===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:!0===this.options.mouseDrag&&!1===this.options.touchDrag&&(a=["mousedown.owl","mousemove.owl","mouseup.owl"]);this.ev_types.start=a[0];this.ev_types.move=a[1];this.ev_types.end=a[2]},disabledEvents:function(){this.$elem.on("dragstart.owl",function(a){a.preventDefault()});this.$elem.on("mousedown.disableTextSelect",function(a){return f(a.target).is("input, textarea, select, option")})},
|
||||
gestures:function(){function a(a){if(void 0!==a.touches)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(void 0===a.touches){if(void 0!==a.pageX)return{x:a.pageX,y:a.pageY};if(void 0===a.pageX)return{x:a.clientX,y:a.clientY}}}function b(a){"on"===a?(f(k).on(d.ev_types.move,e),f(k).on(d.ev_types.end,c)):"off"===a&&(f(k).off(d.ev_types.move),f(k).off(d.ev_types.end))}function e(b){b=b.originalEvent||b||g.event;d.newPosX=a(b).x-h.offsetX;d.newPosY=a(b).y-h.offsetY;d.newRelativeX=d.newPosX-h.relativePos;
|
||||
"function"===typeof d.options.startDragging&&!0!==h.dragging&&0!==d.newRelativeX&&(h.dragging=!0,d.options.startDragging.apply(d,[d.$elem]));(8<d.newRelativeX||-8>d.newRelativeX)&&!0===d.browser.isTouch&&(void 0!==b.preventDefault?b.preventDefault():b.returnValue=!1,h.sliding=!0);(10<d.newPosY||-10>d.newPosY)&&!1===h.sliding&&f(k).off("touchmove.owl");d.newPosX=Math.max(Math.min(d.newPosX,d.newRelativeX/5),d.maximumPixels+d.newRelativeX/5);!0===d.browser.support3d?d.transition3d(d.newPosX):d.css2move(d.newPosX)}
|
||||
function c(a){a=a.originalEvent||a||g.event;var c;a.target=a.target||a.srcElement;h.dragging=!1;!0!==d.browser.isTouch&&d.$owlWrapper.removeClass("grabbing");d.dragDirection=0>d.newRelativeX?d.owl.dragDirection="left":d.owl.dragDirection="right";0!==d.newRelativeX&&(c=d.getNewPosition(),d.goTo(c,!1,"drag"),h.targetElement===a.target&&!0!==d.browser.isTouch&&(f(a.target).on("click.disable",function(a){a.stopImmediatePropagation();a.stopPropagation();a.preventDefault();f(a.target).off("click.disable")}),
|
||||
a=f._data(a.target,"events").click,c=a.pop(),a.splice(0,0,c)));b("off")}var d=this,h={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};d.isCssFinish=!0;d.$elem.on(d.ev_types.start,".owl-wrapper",function(c){c=c.originalEvent||c||g.event;var e;if(3===c.which)return!1;if(!(d.itemsAmount<=d.options.items)){if(!1===d.isCssFinish&&!d.options.dragBeforeAnimFinish||!1===d.isCss3Finish&&!d.options.dragBeforeAnimFinish)return!1;
|
||||
!1!==d.options.autoPlay&&g.clearInterval(d.autoPlayInterval);!0===d.browser.isTouch||d.$owlWrapper.hasClass("grabbing")||d.$owlWrapper.addClass("grabbing");d.newPosX=0;d.newRelativeX=0;f(this).css(d.removeTransition());e=f(this).position();h.relativePos=e.left;h.offsetX=a(c).x-e.left;h.offsetY=a(c).y-e.top;b("on");h.sliding=!1;h.targetElement=c.target||c.srcElement}})},getNewPosition:function(){var a=this.closestItem();a>this.maximumItem?a=this.currentItem=this.maximumItem:0<=this.newPosX&&(this.currentItem=
|
||||
a=0);return a},closestItem:function(){var a=this,b=!0===a.options.scrollPerPage?a.pagesInArray:a.positionsInArray,e=a.newPosX,c=null;f.each(b,function(d,g){e-a.itemWidth/20>b[d+1]&&e-a.itemWidth/20<g&&"left"===a.moveDirection()?(c=g,a.currentItem=!0===a.options.scrollPerPage?f.inArray(c,a.positionsInArray):d):e+a.itemWidth/20<g&&e+a.itemWidth/20>(b[d+1]||b[d]-a.itemWidth)&&"right"===a.moveDirection()&&(!0===a.options.scrollPerPage?(c=b[d+1]||b[b.length-1],a.currentItem=f.inArray(c,a.positionsInArray)):
|
||||
(c=b[d+1],a.currentItem=d+1))});return a.currentItem},moveDirection:function(){var a;0>this.newRelativeX?(a="right",this.playDirection="next"):(a="left",this.playDirection="prev");return a},customEvents:function(){var a=this;a.$elem.on("owl.next",function(){a.next()});a.$elem.on("owl.prev",function(){a.prev()});a.$elem.on("owl.play",function(b,e){a.options.autoPlay=e;a.play();a.hoverStatus="play"});a.$elem.on("owl.stop",function(){a.stop();a.hoverStatus="stop"});a.$elem.on("owl.goTo",function(b,e){a.goTo(e)});
|
||||
a.$elem.on("owl.jumpTo",function(b,e){a.jumpTo(e)})},stopOnHover:function(){var a=this;!0===a.options.stopOnHover&&!0!==a.browser.isTouch&&!1!==a.options.autoPlay&&(a.$elem.on("mouseover",function(){a.stop()}),a.$elem.on("mouseout",function(){"stop"!==a.hoverStatus&&a.play()}))},lazyLoad:function(){var a,b,e,c,d;if(!1===this.options.lazyLoad)return!1;for(a=0;a<this.itemsAmount;a+=1)b=f(this.$owlItems[a]),"loaded"!==b.data("owl-loaded")&&(e=b.data("owl-item"),c=b.find(".lazyOwl"),"string"!==typeof c.data("src")?
|
||||
b.data("owl-loaded","loaded"):(void 0===b.data("owl-loaded")&&(c.hide(),b.addClass("loading").data("owl-loaded","checked")),(d=!0===this.options.lazyFollow?e>=this.currentItem:!0)&&e<this.currentItem+this.options.items&&c.length&&this.lazyPreload(b,c)))},lazyPreload:function(a,b){function e(){a.data("owl-loaded","loaded").removeClass("loading");b.removeAttr("data-src");"fade"===d.options.lazyEffect?b.fadeIn(400):b.show();"function"===typeof d.options.afterLazyLoad&&d.options.afterLazyLoad.apply(this,
|
||||
[d.$elem])}function c(){f+=1;d.completeImg(b.get(0))||!0===k?e():100>=f?g.setTimeout(c,100):e()}var d=this,f=0,k;"DIV"===b.prop("tagName")?(b.css("background-image","url("+b.data("src")+")"),k=!0):b[0].src=b.data("src");c()},autoHeight:function(){function a(){var a=f(e.$owlItems[e.currentItem]).height();e.wrapperOuter.css("height",a+"px");e.wrapperOuter.hasClass("autoHeight")||g.setTimeout(function(){e.wrapperOuter.addClass("autoHeight")},0)}function b(){d+=1;e.completeImg(c.get(0))?a():100>=d?g.setTimeout(b,
|
||||
100):e.wrapperOuter.css("height","")}var e=this,c=f(e.$owlItems[e.currentItem]).find("img"),d;void 0!==c.get(0)?(d=0,b()):a()},completeImg:function(a){return!a.complete||"undefined"!==typeof a.naturalWidth&&0===a.naturalWidth?!1:!0},onVisibleItems:function(){var a;!0===this.options.addClassActive&&this.$owlItems.removeClass("active");this.visibleItems=[];for(a=this.currentItem;a<this.currentItem+this.options.items;a+=1)this.visibleItems.push(a),!0===this.options.addClassActive&&f(this.$owlItems[a]).addClass("active");
|
||||
this.owl.visibleItems=this.visibleItems},transitionTypes:function(a){this.outClass="owl-"+a+"-out";this.inClass="owl-"+a+"-in"},singleItemTransition:function(){var a=this,b=a.outClass,e=a.inClass,c=a.$owlItems.eq(a.currentItem),d=a.$owlItems.eq(a.prevItem),f=Math.abs(a.positionsInArray[a.currentItem])+a.positionsInArray[a.prevItem],g=Math.abs(a.positionsInArray[a.currentItem])+a.itemWidth/2;a.isTransition=!0;a.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":g+"px","-moz-perspective-origin":g+
|
||||
"px","perspective-origin":g+"px"});d.css({position:"relative",left:f+"px"}).addClass(b).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endPrev=!0;d.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(d,b)});c.addClass(e).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endCurrent=!0;c.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(c,e)})},clearTransStyle:function(a,
|
||||
b){a.css({position:"",left:""}).removeClass(b);this.endPrev&&this.endCurrent&&(this.$owlWrapper.removeClass("owl-origin"),this.isTransition=this.endCurrent=this.endPrev=!1)},owlStatus:function(){this.owl={userOptions:this.userOptions,baseElement:this.$elem,userItems:this.$userItems,owlItems:this.$owlItems,currentItem:this.currentItem,prevItem:this.prevItem,visibleItems:this.visibleItems,isTouch:this.browser.isTouch,browser:this.browser,dragDirection:this.dragDirection}},clearEvents:function(){this.$elem.off(".owl owl mousedown.disableTextSelect");
|
||||
f(k).off(".owl owl");f(g).off("resize",this.resizer)},unWrap:function(){0!==this.$elem.children().length&&(this.$owlWrapper.unwrap(),this.$userItems.unwrap().unwrap(),this.owlControls&&this.owlControls.remove());this.clearEvents();this.$elem.attr("style",this.$elem.data("owl-originalStyles")||"").attr("class",this.$elem.data("owl-originalClasses"))},destroy:function(){this.stop();g.clearInterval(this.checkVisible);this.unWrap();this.$elem.removeData()},reinit:function(a){a=f.extend({},this.userOptions,
|
||||
a);this.unWrap();this.init(a,this.$elem)},addItem:function(a,b){var e;if(!a)return!1;if(0===this.$elem.children().length)return this.$elem.append(a),this.setVars(),!1;this.unWrap();e=void 0===b||-1===b?-1:b;e>=this.$userItems.length||-1===e?this.$userItems.eq(-1).after(a):this.$userItems.eq(e).before(a);this.setVars()},removeItem:function(a){if(0===this.$elem.children().length)return!1;a=void 0===a||-1===a?-1:a;this.unWrap();this.$userItems.eq(a).remove();this.setVars()}};f.fn.owlCarousel=function(a){return this.each(function(){if(!0===
|
||||
f(this).data("owl-init"))return!1;f(this).data("owl-init",!0);var b=Object.create(l);b.init(a,this);f.data(this,"owlCarousel",b)})};f.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1E3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,
|
||||
responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:g,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}})(jQuery,window,document);
|
168
js/scripts.js
Normal file
168
js/scripts.js
Normal file
|
@ -0,0 +1,168 @@
|
|||
/*
|
||||
scripts.js
|
||||
|
||||
License: GNU General Public License v3.0
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Copyright: (c) 2013 Alexander "Alx" Agnarson, http://alx.media
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
/* Toggle header search
|
||||
/* ------------------------------------ */
|
||||
$('.toggle-search').on('click', function() {
|
||||
$('.toggle-search').toggleClass('active');
|
||||
$('.search-expand').fadeToggle(250);
|
||||
setTimeout(function(){
|
||||
$('.search-expand input').focus();
|
||||
}, 300);
|
||||
});
|
||||
|
||||
/* Scroll to top
|
||||
/* ------------------------------------ */
|
||||
$('a#back-to-top').on('click', function() {
|
||||
$('html, body').animate({scrollTop:0},'slow');
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Tabs widget
|
||||
/* ------------------------------------ */
|
||||
(function() {
|
||||
var $tabsNav = $('.alx-tabs-nav'),
|
||||
$tabsNavLis = $tabsNav.children('li'),
|
||||
$tabsContainer = $('.alx-tabs-container');
|
||||
|
||||
$tabsNav.each(function() {
|
||||
var $this = $(this);
|
||||
$this.next().children('.alx-tab').stop(true,true).hide()
|
||||
.siblings( $this.find('a').attr('href') ).show();
|
||||
$this.children('li').first().addClass('active').stop(true,true).show();
|
||||
});
|
||||
|
||||
$tabsNavLis.on('click', function(e) {
|
||||
var $this = $(this);
|
||||
|
||||
$this.siblings().removeClass('active').end()
|
||||
.addClass('active');
|
||||
|
||||
$this.parent().next().children('.alx-tab').stop(true,true).hide()
|
||||
.siblings( $this.find('a').attr('href') ).fadeIn();
|
||||
e.preventDefault();
|
||||
}).children( window.location.hash ? 'a[href="' + window.location.hash + '"]' : 'a:first' ).trigger('click');
|
||||
|
||||
})();
|
||||
|
||||
/* Comments / pingbacks tabs
|
||||
/* ------------------------------------ */
|
||||
$('.comment-tabs li').on('click', function() {
|
||||
$('.comment-tabs li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('.comment-tab').hide();
|
||||
var selected_tab = $(this).find('a').attr('href');
|
||||
$(selected_tab).fadeIn();
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Table odd row class
|
||||
/* ------------------------------------ */
|
||||
$('table tr:odd').addClass('alt');
|
||||
|
||||
/* Sidebar collapse
|
||||
/* ------------------------------------ */
|
||||
$('body').addClass('s1-collapse');
|
||||
$('body').addClass('s2-collapse');
|
||||
|
||||
$('.s1 .sidebar-toggle').on('click', function() {
|
||||
$('body').toggleClass('s1-collapse').toggleClass('s1-expand');
|
||||
if ($('body').is('.s2-expand')) {
|
||||
$('body').toggleClass('s2-expand').toggleClass('s2-collapse');
|
||||
}
|
||||
});
|
||||
$('.s2 .sidebar-toggle').on('click', function() {
|
||||
$('body').toggleClass('s2-collapse').toggleClass('s2-expand');
|
||||
if ($('body').is('.s1-expand')) {
|
||||
$('body').toggleClass('s1-expand').toggleClass('s1-collapse');
|
||||
}
|
||||
});
|
||||
|
||||
/* Dropdown menu animation
|
||||
/* ------------------------------------ */
|
||||
$('.nav ul.sub-menu').hide();
|
||||
$('.nav li').hover(
|
||||
function() {
|
||||
$(this).children('ul.sub-menu').slideDown('fast');
|
||||
},
|
||||
function() {
|
||||
$(this).children('ul.sub-menu').hide();
|
||||
}
|
||||
);
|
||||
|
||||
/* Fitvids
|
||||
/* ------------------------------------ */
|
||||
function responsiveVideo() {
|
||||
if ( $().fitVids ) {
|
||||
$('#wrapper').fitVids();
|
||||
}
|
||||
}
|
||||
|
||||
responsiveVideo();
|
||||
|
||||
/* Owl Carousel
|
||||
/* ------------------------------------ */
|
||||
$("#owl-featured").owlCarousel({
|
||||
navigation : false,
|
||||
items : 6,
|
||||
itemsDesktop : [1440,4],
|
||||
itemsDesktopSmall : [1024,3],
|
||||
itemsTablet: [768,3],
|
||||
itemsTabletSmall: [568,2],
|
||||
itemsMobile : [479,1],
|
||||
});
|
||||
|
||||
/* Mobile menu smooth toggle height
|
||||
/* ------------------------------------ */
|
||||
$('.nav-toggle').on('click', function() {
|
||||
slide($('.nav-wrap .nav', $(this).parent()));
|
||||
});
|
||||
|
||||
function slide(content) {
|
||||
var wrapper = content.parent();
|
||||
var contentHeight = content.outerHeight(true);
|
||||
var wrapperHeight = wrapper.height();
|
||||
|
||||
wrapper.toggleClass('expand');
|
||||
if (wrapper.hasClass('expand')) {
|
||||
setTimeout(function() {
|
||||
wrapper.addClass('transition').css('height', contentHeight);
|
||||
}, 10);
|
||||
}
|
||||
else {
|
||||
setTimeout(function() {
|
||||
wrapper.css('height', wrapperHeight);
|
||||
setTimeout(function() {
|
||||
wrapper.addClass('transition').css('height', 0);
|
||||
}, 10);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
wrapper.one('transitionEnd webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd', function() {
|
||||
if(wrapper.hasClass('open')) {
|
||||
wrapper.removeClass('transition').css('height', 'auto');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Social count plus override
|
||||
/* ------------------------------------ */
|
||||
$('.social-count-plus ul li span').attr('style', 'color: #fff');
|
||||
|
||||
/* Stickyfill
|
||||
/* ------------------------------------ */
|
||||
if ($(window).width() >= 1024){
|
||||
$('.stickyfill').Stickyfill();
|
||||
}
|
||||
|
||||
});
|
8
js/stickyfill.min.js
vendored
Normal file
8
js/stickyfill.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue