Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,679 @@
|
||||
// SmoothScroll for websites v1.3.8 (Balazs Galambosi)
|
||||
// Licensed under the terms of the MIT license.
|
||||
//
|
||||
// You may use it in your theme if you credit me.
|
||||
// It is also free to use on any individual website.
|
||||
//
|
||||
// Exception:
|
||||
// The only restriction would be not to publish any
|
||||
// extension for browsers or native application
|
||||
// without getting a written permission first.
|
||||
//
|
||||
|
||||
(function () {
|
||||
|
||||
// Scroll Variables (tweakable)
|
||||
var defaultOptions = {
|
||||
|
||||
// Scrolling Core
|
||||
frameRate : 150, // [Hz]
|
||||
animationTime : 400, // [px]
|
||||
stepSize : 120, // [px]
|
||||
|
||||
// Pulse (less tweakable)
|
||||
// ratio of "tail" to "acceleration"
|
||||
pulseAlgorithm : true,
|
||||
pulseScale : 4,
|
||||
pulseNormalize : 1,
|
||||
|
||||
// Acceleration
|
||||
accelerationDelta : 20, // 20
|
||||
accelerationMax : 1, // 1
|
||||
|
||||
// Keyboard Settings
|
||||
keyboardSupport : true, // option
|
||||
arrowScroll : 50, // [px]
|
||||
|
||||
// Other
|
||||
touchpadSupport : true,
|
||||
fixedBackground : true,
|
||||
excluded : ''
|
||||
};
|
||||
|
||||
var options = defaultOptions;
|
||||
|
||||
|
||||
// Other Variables
|
||||
var isExcluded = false;
|
||||
var isFrame = false;
|
||||
var direction = { x: 0, y: 0 };
|
||||
var initDone = false;
|
||||
var root = document.documentElement;
|
||||
var activeElement;
|
||||
var observer;
|
||||
var deltaBuffer = [];
|
||||
var isMac = /^Mac/.test(navigator.platform);
|
||||
|
||||
var key = { left: 37, up: 38, right: 39, down: 40, spacebar: 32,
|
||||
pageup: 33, pagedown: 34, end: 35, home: 36 };
|
||||
|
||||
|
||||
/***********************************************
|
||||
* SETTINGS
|
||||
***********************************************/
|
||||
|
||||
var options = defaultOptions;
|
||||
|
||||
|
||||
/***********************************************
|
||||
* INITIALIZE
|
||||
***********************************************/
|
||||
|
||||
/**
|
||||
* Tests if smooth scrolling is allowed. Shuts down everything if not.
|
||||
*/
|
||||
function initTest() {
|
||||
if (options.keyboardSupport) {
|
||||
addEvent('keydown', keydown);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up scrolls array, determines if frames are involved.
|
||||
*/
|
||||
function init() {
|
||||
|
||||
if (initDone || !document.body) return;
|
||||
|
||||
initDone = true;
|
||||
|
||||
var body = document.body;
|
||||
var html = document.documentElement;
|
||||
var windowHeight = window.innerHeight;
|
||||
var scrollHeight = body.scrollHeight;
|
||||
|
||||
// check compat mode for root element
|
||||
root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;
|
||||
activeElement = body;
|
||||
|
||||
initTest();
|
||||
|
||||
// Checks if this script is running in a frame
|
||||
if (top != self) {
|
||||
isFrame = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This fixes a bug where the areas left and right to
|
||||
* the content does not trigger the onmousewheel event
|
||||
* on some pages. e.g.: html, body { height: 100% }
|
||||
*/
|
||||
else if (scrollHeight > windowHeight &&
|
||||
(body.offsetHeight <= windowHeight ||
|
||||
html.offsetHeight <= windowHeight)) {
|
||||
|
||||
var fullPageElem = document.createElement('div');
|
||||
fullPageElem.style.cssText = 'position:absolute; z-index:-10000; ' +
|
||||
'top:0; left:0; right:0; height:' +
|
||||
root.scrollHeight + 'px';
|
||||
document.body.appendChild(fullPageElem);
|
||||
|
||||
// DOM changed (throttled) to fix height
|
||||
var pendingRefresh;
|
||||
var refresh = function () {
|
||||
if (pendingRefresh) return; // could also be: clearTimeout(pendingRefresh);
|
||||
pendingRefresh = setTimeout(function () {
|
||||
if (isExcluded) return; // could be running after cleanup
|
||||
fullPageElem.style.height = '0';
|
||||
fullPageElem.style.height = root.scrollHeight + 'px';
|
||||
pendingRefresh = null;
|
||||
}, 500); // act rarely to stay fast
|
||||
};
|
||||
|
||||
setTimeout(refresh, 10);
|
||||
|
||||
// TODO: attributeFilter?
|
||||
var config = {
|
||||
attributes: true,
|
||||
childList: true,
|
||||
characterData: false
|
||||
// subtree: true
|
||||
};
|
||||
|
||||
observer = new MutationObserver(refresh);
|
||||
observer.observe(body, config);
|
||||
|
||||
if (root.offsetHeight <= windowHeight) {
|
||||
var clearfix = document.createElement('div');
|
||||
clearfix.style.clear = 'both';
|
||||
body.appendChild(clearfix);
|
||||
}
|
||||
}
|
||||
|
||||
// disable fixed background
|
||||
if (!options.fixedBackground && !isExcluded) {
|
||||
body.style.backgroundAttachment = 'scroll';
|
||||
html.style.backgroundAttachment = 'scroll';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes event listeners and other traces left on the page.
|
||||
*/
|
||||
function cleanup() {
|
||||
observer && observer.disconnect();
|
||||
removeEvent(wheelEvent, wheel);
|
||||
removeEvent('mousedown', mousedown);
|
||||
removeEvent('keydown', keydown);
|
||||
}
|
||||
|
||||
|
||||
/************************************************
|
||||
* SCROLLING
|
||||
************************************************/
|
||||
|
||||
var que = [];
|
||||
var pending = false;
|
||||
var lastScroll = Date.now();
|
||||
|
||||
/**
|
||||
* Pushes scroll actions to the scrolling queue.
|
||||
*/
|
||||
function scrollArray(elem, left, top) {
|
||||
|
||||
directionCheck(left, top);
|
||||
|
||||
if (options.accelerationMax != 1) {
|
||||
var now = Date.now();
|
||||
var elapsed = now - lastScroll;
|
||||
if (elapsed < options.accelerationDelta) {
|
||||
var factor = (1 + (50 / elapsed)) / 2;
|
||||
if (factor > 1) {
|
||||
factor = Math.min(factor, options.accelerationMax);
|
||||
left *= factor;
|
||||
top *= factor;
|
||||
}
|
||||
}
|
||||
lastScroll = Date.now();
|
||||
}
|
||||
|
||||
// push a scroll command
|
||||
que.push({
|
||||
x: left,
|
||||
y: top,
|
||||
lastX: (left < 0) ? 0.99 : -0.99,
|
||||
lastY: (top < 0) ? 0.99 : -0.99,
|
||||
start: Date.now()
|
||||
});
|
||||
|
||||
// don't act if there's a pending queue
|
||||
if (pending) {
|
||||
return;
|
||||
}
|
||||
|
||||
var scrollWindow = (elem === document.body);
|
||||
|
||||
var step = function (time) {
|
||||
|
||||
var now = Date.now();
|
||||
var scrollX = 0;
|
||||
var scrollY = 0;
|
||||
|
||||
for (var i = 0; i < que.length; i++) {
|
||||
|
||||
var item = que[i];
|
||||
var elapsed = now - item.start;
|
||||
var finished = (elapsed >= options.animationTime);
|
||||
|
||||
// scroll position: [0, 1]
|
||||
var position = (finished) ? 1 : elapsed / options.animationTime;
|
||||
|
||||
// easing [optional]
|
||||
if (options.pulseAlgorithm) {
|
||||
position = pulse(position);
|
||||
}
|
||||
|
||||
// only need the difference
|
||||
var x = (item.x * position - item.lastX) >> 0;
|
||||
var y = (item.y * position - item.lastY) >> 0;
|
||||
|
||||
// add this to the total scrolling
|
||||
scrollX += x;
|
||||
scrollY += y;
|
||||
|
||||
// update last values
|
||||
item.lastX += x;
|
||||
item.lastY += y;
|
||||
|
||||
// delete and step back if it's over
|
||||
if (finished) {
|
||||
que.splice(i, 1); i--;
|
||||
}
|
||||
}
|
||||
|
||||
// scroll left and top
|
||||
if (scrollWindow) {
|
||||
window.scrollBy(scrollX, scrollY);
|
||||
}
|
||||
else {
|
||||
if (scrollX) elem.scrollLeft += scrollX;
|
||||
if (scrollY) elem.scrollTop += scrollY;
|
||||
}
|
||||
|
||||
// clean up if there's nothing left to do
|
||||
if (!left && !top) {
|
||||
que = [];
|
||||
}
|
||||
|
||||
if (que.length) {
|
||||
requestFrame(step, elem, (1000 / options.frameRate + 1));
|
||||
} else {
|
||||
pending = false;
|
||||
}
|
||||
};
|
||||
|
||||
// start a new queue of actions
|
||||
requestFrame(step, elem, 0);
|
||||
pending = true;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************
|
||||
* EVENTS
|
||||
***********************************************/
|
||||
|
||||
/**
|
||||
* Mouse wheel handler.
|
||||
* @param {Object} event
|
||||
*/
|
||||
function wheel(event) {
|
||||
|
||||
if (!initDone) {
|
||||
init();
|
||||
}
|
||||
|
||||
var target = event.target;
|
||||
var overflowing = overflowingAncestor(target);
|
||||
|
||||
// use default if there's no overflowing
|
||||
// element or default action is prevented
|
||||
// or it's a zooming event with CTRL
|
||||
if (!overflowing || event.defaultPrevented || event.ctrlKey) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// leave embedded content alone (flash & pdf)
|
||||
if (isNodeName(activeElement, 'embed') ||
|
||||
(isNodeName(target, 'embed') && /\.pdf/i.test(target.src)) ||
|
||||
isNodeName(activeElement, 'object')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var deltaX = -event.wheelDeltaX || event.deltaX || 0;
|
||||
var deltaY = -event.wheelDeltaY || event.deltaY || 0;
|
||||
|
||||
if (isMac) {
|
||||
if (event.wheelDeltaX && isDivisible(event.wheelDeltaX, 120)) {
|
||||
deltaX = -120 * (event.wheelDeltaX / Math.abs(event.wheelDeltaX));
|
||||
}
|
||||
if (event.wheelDeltaY && isDivisible(event.wheelDeltaY, 120)) {
|
||||
deltaY = -120 * (event.wheelDeltaY / Math.abs(event.wheelDeltaY));
|
||||
}
|
||||
}
|
||||
|
||||
// use wheelDelta if deltaX/Y is not available
|
||||
if (!deltaX && !deltaY) {
|
||||
deltaY = -event.wheelDelta || 0;
|
||||
}
|
||||
|
||||
// line based scrolling (Firefox mostly)
|
||||
if (event.deltaMode === 1) {
|
||||
deltaX *= 40;
|
||||
deltaY *= 40;
|
||||
}
|
||||
|
||||
// check if it's a touchpad scroll that should be ignored
|
||||
if (!options.touchpadSupport && isTouchpad(deltaY)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// scale by step size
|
||||
// delta is 120 most of the time
|
||||
// synaptics seems to send 1 sometimes
|
||||
if (Math.abs(deltaX) > 1.2) {
|
||||
deltaX *= options.stepSize / 120;
|
||||
}
|
||||
if (Math.abs(deltaY) > 1.2) {
|
||||
deltaY *= options.stepSize / 120;
|
||||
}
|
||||
|
||||
scrollArray(overflowing, deltaX, deltaY);
|
||||
event.preventDefault();
|
||||
scheduleClearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Keydown event handler.
|
||||
* @param {Object} event
|
||||
*/
|
||||
function keydown(event) {
|
||||
|
||||
var target = event.target;
|
||||
var modifier = event.ctrlKey || event.altKey || event.metaKey ||
|
||||
(event.shiftKey && event.keyCode !== key.spacebar);
|
||||
|
||||
// our own tracked active element could've been removed from the DOM
|
||||
if (!document.contains(activeElement)) {
|
||||
activeElement = document.activeElement;
|
||||
}
|
||||
|
||||
// do nothing if user is editing text
|
||||
// or using a modifier key (except shift)
|
||||
// or in a dropdown
|
||||
// or inside interactive elements
|
||||
var inputNodeNames = /^(textarea|select|embed|object)$/i;
|
||||
var buttonTypes = /^(button|submit|radio|checkbox|file|color|image)$/i;
|
||||
if ( inputNodeNames.test(target.nodeName) ||
|
||||
isNodeName(target, 'input') && !buttonTypes.test(target.type) ||
|
||||
isNodeName(activeElement, 'video') ||
|
||||
isInsideYoutubeVideo(event) ||
|
||||
target.isContentEditable ||
|
||||
event.defaultPrevented ||
|
||||
modifier ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// spacebar should trigger button press
|
||||
if ((isNodeName(target, 'button') ||
|
||||
isNodeName(target, 'input') && buttonTypes.test(target.type)) &&
|
||||
event.keyCode === key.spacebar) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var shift, x = 0, y = 0;
|
||||
var elem = overflowingAncestor(activeElement);
|
||||
var clientHeight = elem.clientHeight;
|
||||
|
||||
if (elem == document.body) {
|
||||
clientHeight = window.innerHeight;
|
||||
}
|
||||
|
||||
switch (event.keyCode) {
|
||||
case key.up:
|
||||
y = -options.arrowScroll;
|
||||
break;
|
||||
case key.down:
|
||||
y = options.arrowScroll;
|
||||
break;
|
||||
case key.spacebar: // (+ shift)
|
||||
shift = event.shiftKey ? 1 : -1;
|
||||
y = -shift * clientHeight * 0.9;
|
||||
break;
|
||||
case key.pageup:
|
||||
y = -clientHeight * 0.9;
|
||||
break;
|
||||
case key.pagedown:
|
||||
y = clientHeight * 0.9;
|
||||
break;
|
||||
case key.home:
|
||||
y = -elem.scrollTop;
|
||||
break;
|
||||
case key.end:
|
||||
var damt = elem.scrollHeight - elem.scrollTop - clientHeight;
|
||||
y = (damt > 0) ? damt+10 : 0;
|
||||
break;
|
||||
case key.left:
|
||||
x = -options.arrowScroll;
|
||||
break;
|
||||
case key.right:
|
||||
x = options.arrowScroll;
|
||||
break;
|
||||
default:
|
||||
return true; // a key we don't care about
|
||||
}
|
||||
|
||||
scrollArray(elem, x, y);
|
||||
event.preventDefault();
|
||||
scheduleClearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mousedown event only for updating activeElement
|
||||
*/
|
||||
function mousedown(event) {
|
||||
activeElement = event.target;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************
|
||||
* OVERFLOW
|
||||
***********************************************/
|
||||
|
||||
var uniqueID = (function () {
|
||||
var i = 0;
|
||||
return function (el) {
|
||||
return el.uniqueID || (el.uniqueID = i++);
|
||||
};
|
||||
})();
|
||||
|
||||
var cache = {}; // cleared out after a scrolling session
|
||||
var clearCacheTimer;
|
||||
|
||||
//setInterval(function () { cache = {}; }, 10 * 1000);
|
||||
|
||||
function scheduleClearCache() {
|
||||
clearTimeout(clearCacheTimer);
|
||||
clearCacheTimer = setInterval(function () { cache = {}; }, 1*1000);
|
||||
}
|
||||
|
||||
function setCache(elems, overflowing) {
|
||||
for (var i = elems.length; i--;)
|
||||
cache[uniqueID(elems[i])] = overflowing;
|
||||
return overflowing;
|
||||
}
|
||||
|
||||
// (body) (root)
|
||||
// | hidden | visible | scroll | auto |
|
||||
// hidden | no | no | YES | YES |
|
||||
// visible | no | YES | YES | YES |
|
||||
// scroll | no | YES | YES | YES |
|
||||
// auto | no | YES | YES | YES |
|
||||
|
||||
function overflowingAncestor(el) {
|
||||
var elems = [];
|
||||
var body = document.body;
|
||||
var rootScrollHeight = root.scrollHeight;
|
||||
do {
|
||||
var cached = cache[uniqueID(el)];
|
||||
if (cached) {
|
||||
return setCache(elems, cached);
|
||||
}
|
||||
elems.push(el);
|
||||
if (rootScrollHeight === el.scrollHeight) {
|
||||
var topOverflowsNotHidden = overflowNotHidden(root) && overflowNotHidden(body);
|
||||
var isOverflowCSS = topOverflowsNotHidden || overflowAutoOrScroll(root);
|
||||
if (isFrame && isContentOverflowing(root) ||
|
||||
!isFrame && isOverflowCSS) {
|
||||
return setCache(elems, getScrollRoot());
|
||||
}
|
||||
} else if (isContentOverflowing(el) && overflowAutoOrScroll(el)) {
|
||||
return setCache(elems, el);
|
||||
}
|
||||
} while (el = el.parentElement);
|
||||
}
|
||||
|
||||
function isContentOverflowing(el) {
|
||||
return (el.clientHeight + 10 < el.scrollHeight);
|
||||
}
|
||||
|
||||
// typically for <body> and <html>
|
||||
function overflowNotHidden(el) {
|
||||
var overflow = getComputedStyle(el, '').getPropertyValue('overflow-y');
|
||||
return (overflow !== 'hidden');
|
||||
}
|
||||
|
||||
// for all other elements
|
||||
function overflowAutoOrScroll(el) {
|
||||
var overflow = getComputedStyle(el, '').getPropertyValue('overflow-y');
|
||||
return (overflow === 'scroll' || overflow === 'auto');
|
||||
}
|
||||
|
||||
|
||||
/***********************************************
|
||||
* HELPERS
|
||||
***********************************************/
|
||||
|
||||
function addEvent(type, fn) {
|
||||
window.addEventListener(type, fn, false);
|
||||
}
|
||||
|
||||
function removeEvent(type, fn) {
|
||||
window.removeEventListener(type, fn, false);
|
||||
}
|
||||
|
||||
function isNodeName(el, tag) {
|
||||
return (el.nodeName||'').toLowerCase() === tag.toLowerCase();
|
||||
}
|
||||
|
||||
function directionCheck(x, y) {
|
||||
x = (x > 0) ? 1 : -1;
|
||||
y = (y > 0) ? 1 : -1;
|
||||
if (direction.x !== x || direction.y !== y) {
|
||||
direction.x = x;
|
||||
direction.y = y;
|
||||
que = [];
|
||||
lastScroll = 0;
|
||||
}
|
||||
}
|
||||
|
||||
var deltaBufferTimer;
|
||||
|
||||
if (window.localStorage && localStorage.SS_deltaBuffer) {
|
||||
deltaBuffer = localStorage.SS_deltaBuffer.split(',');
|
||||
}
|
||||
|
||||
function isTouchpad(deltaY) {
|
||||
if (!deltaY) return;
|
||||
if (!deltaBuffer.length) {
|
||||
deltaBuffer = [deltaY, deltaY, deltaY];
|
||||
}
|
||||
deltaY = Math.abs(deltaY)
|
||||
deltaBuffer.push(deltaY);
|
||||
deltaBuffer.shift();
|
||||
clearTimeout(deltaBufferTimer);
|
||||
deltaBufferTimer = setTimeout(function () {
|
||||
if (window.localStorage) {
|
||||
localStorage.SS_deltaBuffer = deltaBuffer.join(',');
|
||||
}
|
||||
}, 1000);
|
||||
return !allDeltasDivisableBy(120) && !allDeltasDivisableBy(100);
|
||||
}
|
||||
|
||||
function isDivisible(n, divisor) {
|
||||
return (Math.floor(n / divisor) == n / divisor);
|
||||
}
|
||||
|
||||
function allDeltasDivisableBy(divisor) {
|
||||
return (isDivisible(deltaBuffer[0], divisor) &&
|
||||
isDivisible(deltaBuffer[1], divisor) &&
|
||||
isDivisible(deltaBuffer[2], divisor));
|
||||
}
|
||||
|
||||
function isInsideYoutubeVideo(event) {
|
||||
var elem = event.target;
|
||||
var isControl = false;
|
||||
if (document.URL.indexOf ('www.youtube.com/watch') != -1) {
|
||||
do {
|
||||
isControl = (elem.classList &&
|
||||
elem.classList.contains('html5-video-controls'));
|
||||
if (isControl) break;
|
||||
} while (elem = elem.parentNode);
|
||||
}
|
||||
return isControl;
|
||||
}
|
||||
|
||||
var requestFrame = (function () {
|
||||
return (window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
function (callback, element, delay) {
|
||||
window.setTimeout(callback, delay || (1000/60));
|
||||
});
|
||||
})();
|
||||
|
||||
var MutationObserver = (window.MutationObserver ||
|
||||
window.WebKitMutationObserver ||
|
||||
window.MozMutationObserver);
|
||||
|
||||
var getScrollRoot = (function() {
|
||||
var SCROLL_ROOT;
|
||||
return function() {
|
||||
if (!SCROLL_ROOT) {
|
||||
var dummy = document.createElement('div');
|
||||
dummy.style.cssText = 'height:10000px;width:1px;';
|
||||
document.body.appendChild(dummy);
|
||||
var bodyScrollTop = document.body.scrollTop;
|
||||
var docElScrollTop = document.documentElement.scrollTop;
|
||||
window.scrollBy(0, 1);
|
||||
if (document.body.scrollTop != bodyScrollTop)
|
||||
(SCROLL_ROOT = document.body);
|
||||
else
|
||||
(SCROLL_ROOT = document.documentElement);
|
||||
window.scrollBy(0, -1);
|
||||
document.body.removeChild(dummy);
|
||||
}
|
||||
return SCROLL_ROOT;
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
/***********************************************
|
||||
* PULSE (by Michael Herf)
|
||||
***********************************************/
|
||||
|
||||
/**
|
||||
* Viscous fluid with a pulse for part and decay for the rest.
|
||||
* - Applies a fixed force over an interval (a damped acceleration), and
|
||||
* - Lets the exponential bleed away the velocity over a longer interval
|
||||
* - Michael Herf, http://stereopsis.com/stopping/
|
||||
*/
|
||||
function pulse_(x) {
|
||||
var val, start, expx;
|
||||
// test
|
||||
x = x * options.pulseScale;
|
||||
if (x < 1) { // acceleartion
|
||||
val = x - (1 - Math.exp(-x));
|
||||
} else { // tail
|
||||
// the previous animation ended here:
|
||||
start = Math.exp(-1);
|
||||
// simple viscous drag
|
||||
x -= 1;
|
||||
expx = 1 - Math.exp(-x);
|
||||
val = start + (expx * (1 - start));
|
||||
}
|
||||
return val * options.pulseNormalize;
|
||||
}
|
||||
|
||||
function pulse(x) {
|
||||
if (x >= 1) return 1;
|
||||
if (x <= 0) return 0;
|
||||
|
||||
if (options.pulseNormalize == 1) {
|
||||
options.pulseNormalize /= pulse_(1);
|
||||
}
|
||||
return pulse_(x);
|
||||
}
|
||||
|
||||
var wheelEvent;
|
||||
if ('onwheel' in document.createElement('div'))
|
||||
wheelEvent = 'wheel';
|
||||
else if ('onmousewheel' in document.createElement('div'))
|
||||
wheelEvent = 'mousewheel';
|
||||
|
||||
if (wheelEvent) {
|
||||
addEvent(wheelEvent, wheel);
|
||||
addEvent('mousedown', mousedown);
|
||||
addEvent('load', init);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,310 @@
|
||||
! function() {
|
||||
function o() {
|
||||
b.keyboardSupport && H("keydown", w)
|
||||
}
|
||||
|
||||
function p() {
|
||||
if (!f && document.body) {
|
||||
f = !0;
|
||||
var a = document.body,
|
||||
e = document.documentElement,
|
||||
k = window.innerHeight,
|
||||
l = a.scrollHeight;
|
||||
if (g = document.compatMode.indexOf("CSS") >= 0 ? e : a, h = a, o(), top != self) d = !0;
|
||||
else if (l > k && (a.offsetHeight <= k || e.offsetHeight <= k)) {
|
||||
var m = document.createElement("div");
|
||||
m.style.cssText = "position:absolute; z-index:-10000; top:0; left:0; right:0; height:" + g.scrollHeight + "px", document.body.appendChild(m);
|
||||
var n;
|
||||
j = function() {
|
||||
n || (n = setTimeout(function() {
|
||||
c || (m.style.height = "0", m.style.height = g.scrollHeight + "px", n = null)
|
||||
}, 500))
|
||||
}, setTimeout(j, 10), H("resize", j);
|
||||
var p = {
|
||||
attributes: !0,
|
||||
childList: !0,
|
||||
characterData: !1
|
||||
};
|
||||
if (i = new R(j), i.observe(a, p), g.offsetHeight <= k) {
|
||||
var q = document.createElement("div");
|
||||
q.style.clear = "both", a.appendChild(q)
|
||||
}
|
||||
}
|
||||
b.fixedBackground || c || (a.style.backgroundAttachment = "scroll", e.style.backgroundAttachment = "scroll")
|
||||
}
|
||||
}
|
||||
|
||||
function q() {
|
||||
i && i.disconnect(), I(Y, v), I("mousedown", x), I("keydown", w), I("resize", j), I("load", p)
|
||||
}
|
||||
|
||||
function u(a, c, d) {
|
||||
if (K(c, d), 1 != b.accelerationMax) {
|
||||
var e = Date.now(),
|
||||
f = e - t;
|
||||
if (f < b.accelerationDelta) {
|
||||
var g = (1 + 50 / f) / 2;
|
||||
g > 1 && (g = Math.min(g, b.accelerationMax), c *= g, d *= g)
|
||||
}
|
||||
t = Date.now()
|
||||
}
|
||||
if (r.push({
|
||||
x: c,
|
||||
y: d,
|
||||
lastX: 0 > c ? .99 : -.99,
|
||||
lastY: 0 > d ? .99 : -.99,
|
||||
start: Date.now()
|
||||
}), !s) {
|
||||
var h = a === document.body,
|
||||
i = function(e) {
|
||||
for (var f = Date.now(), g = 0, j = 0, k = 0; k < r.length; k++) {
|
||||
var l = r[k],
|
||||
m = f - l.start,
|
||||
n = m >= b.animationTime,
|
||||
o = n ? 1 : m / b.animationTime;
|
||||
b.pulseAlgorithm && (o = U(o));
|
||||
var p = l.x * o - l.lastX >> 0,
|
||||
q = l.y * o - l.lastY >> 0;
|
||||
g += p, j += q, l.lastX += p, l.lastY += q, n && (r.splice(k, 1), k--)
|
||||
}
|
||||
h ? window.scrollBy(g, j) : (g && (a.scrollLeft += g), j && (a.scrollTop += j)), c || d || (r = []), r.length ? Q(i, a, 1e3 / b.frameRate + 1) : s = !1
|
||||
};
|
||||
Q(i, a, 0), s = !0
|
||||
}
|
||||
}
|
||||
|
||||
function v(a) {
|
||||
f || p();
|
||||
var c = a.target,
|
||||
d = D(c);
|
||||
if (!d || a.defaultPrevented || a.ctrlKey) return !0;
|
||||
if (J(h, "embed") || J(c, "embed") && /\.pdf/i.test(c.src) || J(h, "object") || c.shadowRoot) return !0;
|
||||
var e = -a.wheelDeltaX || a.deltaX || 0,
|
||||
g = -a.wheelDeltaY || a.deltaY || 0;
|
||||
return l && (a.wheelDeltaX && N(a.wheelDeltaX, 120) && (e = -120 * (a.wheelDeltaX / Math.abs(a.wheelDeltaX))), a.wheelDeltaY && N(a.wheelDeltaY, 120) && (g = -120 * (a.wheelDeltaY / Math.abs(a.wheelDeltaY)))), e || g || (g = -a.wheelDelta || 0), 1 === a.deltaMode && (e *= 40, g *= 40), !b.touchpadSupport && M(g) ? !0 : (Math.abs(e) > 1.2 && (e *= b.stepSize / 120), Math.abs(g) > 1.2 && (g *= b.stepSize / 120), u(d, e, g), a.preventDefault(), void B())
|
||||
}
|
||||
|
||||
function w(a) {
|
||||
var c = a.target,
|
||||
d = a.ctrlKey || a.altKey || a.metaKey || a.shiftKey && a.keyCode !== m.spacebar;
|
||||
document.body.contains(h) || (h = document.activeElement);
|
||||
var e = /^(textarea|select|embed|object)$/i,
|
||||
f = /^(button|submit|radio|checkbox|file|color|image)$/i;
|
||||
if (a.defaultPrevented || e.test(c.nodeName) || J(c, "input") && !f.test(c.type) || J(h, "video") || P(a) || c.isContentEditable || d) return !0;
|
||||
if ((J(c, "button") || J(c, "input") && f.test(c.type)) && a.keyCode === m.spacebar) return !0;
|
||||
if (J(c, "input") && "radio" == c.type && n[a.keyCode]) return !0;
|
||||
var g, i = 0,
|
||||
j = 0,
|
||||
k = D(h),
|
||||
l = k.clientHeight;
|
||||
switch (k == document.body && (l = window.innerHeight), a.keyCode) {
|
||||
case m.up:
|
||||
j = -b.arrowScroll;
|
||||
break;
|
||||
case m.down:
|
||||
j = b.arrowScroll;
|
||||
break;
|
||||
case m.spacebar:
|
||||
g = a.shiftKey ? 1 : -1, j = -g * l * .9;
|
||||
break;
|
||||
case m.pageup:
|
||||
j = .9 * -l;
|
||||
break;
|
||||
case m.pagedown:
|
||||
j = .9 * l;
|
||||
break;
|
||||
case m.home:
|
||||
j = -k.scrollTop;
|
||||
break;
|
||||
case m.end:
|
||||
var o = k.scrollHeight - k.scrollTop - l;
|
||||
j = o > 0 ? o + 10 : 0;
|
||||
break;
|
||||
case m.left:
|
||||
i = -b.arrowScroll;
|
||||
break;
|
||||
case m.right:
|
||||
i = b.arrowScroll;
|
||||
break;
|
||||
default:
|
||||
return !0
|
||||
}
|
||||
u(k, i, j), a.preventDefault(), B()
|
||||
}
|
||||
|
||||
function x(a) {
|
||||
h = a.target
|
||||
}
|
||||
|
||||
function B() {
|
||||
clearTimeout(A), A = setInterval(function() {
|
||||
z = {}
|
||||
}, 1e3)
|
||||
}
|
||||
|
||||
function C(a, b) {
|
||||
for (var c = a.length; c--;) z[y(a[c])] = b;
|
||||
return b
|
||||
}
|
||||
|
||||
function D(a) {
|
||||
var b = [],
|
||||
c = document.body,
|
||||
e = g.scrollHeight;
|
||||
do {
|
||||
var f = z[y(a)];
|
||||
if (f) return C(b, f);
|
||||
if (b.push(a), e === a.scrollHeight) {
|
||||
var h = F(g) && F(c),
|
||||
i = h || G(g);
|
||||
if (d && E(g) || !d && i) return C(b, S())
|
||||
} else if (E(a) && G(a)) return C(b, a)
|
||||
} while (a = a.parentElement)
|
||||
}
|
||||
|
||||
function E(a) {
|
||||
return a.clientHeight + 10 < a.scrollHeight
|
||||
}
|
||||
|
||||
function F(a) {
|
||||
var b = getComputedStyle(a, "").getPropertyValue("overflow-y");
|
||||
return "hidden" !== b
|
||||
}
|
||||
|
||||
function G(a) {
|
||||
var b = getComputedStyle(a, "").getPropertyValue("overflow-y");
|
||||
return "scroll" === b || "auto" === b
|
||||
}
|
||||
|
||||
function H(a, b) {
|
||||
window.addEventListener(a, b, !1)
|
||||
}
|
||||
|
||||
function I(a, b) {
|
||||
window.removeEventListener(a, b, !1)
|
||||
}
|
||||
|
||||
function J(a, b) {
|
||||
return (a.nodeName || "").toLowerCase() === b.toLowerCase()
|
||||
}
|
||||
|
||||
function K(a, b) {
|
||||
a = a > 0 ? 1 : -1, b = b > 0 ? 1 : -1, (e.x !== a || e.y !== b) && (e.x = a, e.y = b, r = [], t = 0)
|
||||
}
|
||||
|
||||
function M(a) {
|
||||
return a ? (k.length || (k = [a, a, a]), a = Math.abs(a), k.push(a), k.shift(), clearTimeout(L), L = setTimeout(function() {
|
||||
window.localStorage && (localStorage.SS_deltaBuffer = k.join(","))
|
||||
}, 1e3), !O(120) && !O(100)) : void 0
|
||||
}
|
||||
|
||||
function N(a, b) {
|
||||
return Math.floor(a / b) == a / b
|
||||
}
|
||||
|
||||
function O(a) {
|
||||
return N(k[0], a) && N(k[1], a) && N(k[2], a)
|
||||
}
|
||||
|
||||
function P(a) {
|
||||
var b = a.target,
|
||||
c = !1;
|
||||
if (-1 != document.URL.indexOf("www.youtube.com/watch"))
|
||||
do
|
||||
if (c = b.classList && b.classList.contains("html5-video-controls")) break;
|
||||
while (b = b.parentNode);
|
||||
return c
|
||||
}
|
||||
|
||||
function T(a) {
|
||||
var c, d, e;
|
||||
return a *= b.pulseScale, 1 > a ? c = a - (1 - Math.exp(-a)) : (d = Math.exp(-1), a -= 1, e = 1 - Math.exp(-a), c = d + e * (1 - d)), c * b.pulseNormalize
|
||||
}
|
||||
|
||||
function U(a) {
|
||||
return a >= 1 ? 1 : 0 >= a ? 0 : (1 == b.pulseNormalize && (b.pulseNormalize /= T(1)), T(a))
|
||||
}
|
||||
|
||||
function Z(c) {
|
||||
for (var d in c) a.hasOwnProperty(d) && (b[d] = c[d])
|
||||
}
|
||||
var h, i, j, A, L, a = {
|
||||
frameRate: 150,
|
||||
animationTime: php_vars.speed,
|
||||
stepSize: php_vars.step,
|
||||
pulseAlgorithm: !0,
|
||||
pulseScale: 4,
|
||||
pulseNormalize: 1,
|
||||
accelerationDelta: 50,
|
||||
accelerationMax: 3,
|
||||
keyboardSupport: !0,
|
||||
arrowScroll: 50,
|
||||
touchpadSupport: !1,
|
||||
fixedBackground: !0,
|
||||
excluded: ""
|
||||
},
|
||||
b = a,
|
||||
c = !1,
|
||||
d = !1,
|
||||
e = {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
f = !1,
|
||||
g = document.documentElement,
|
||||
k = [],
|
||||
l = /^Mac/.test(navigator.platform),
|
||||
m = {
|
||||
left: 37,
|
||||
up: 38,
|
||||
right: 39,
|
||||
down: 40,
|
||||
spacebar: 32,
|
||||
pageup: 33,
|
||||
pagedown: 34,
|
||||
end: 35,
|
||||
home: 36
|
||||
},
|
||||
n = {
|
||||
37: 1,
|
||||
38: 1,
|
||||
39: 1,
|
||||
40: 1
|
||||
},
|
||||
r = [],
|
||||
s = !1,
|
||||
t = Date.now(),
|
||||
y = function() {
|
||||
var a = 0;
|
||||
return function(b) {
|
||||
return b.uniqueID || (b.uniqueID = a++)
|
||||
}
|
||||
}(),
|
||||
z = {};
|
||||
window.localStorage && localStorage.SS_deltaBuffer && (k = localStorage.SS_deltaBuffer.split(","));
|
||||
var Y, Q = function() {
|
||||
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(a, b, c) {
|
||||
window.setTimeout(a, c || 1e3 / 60)
|
||||
}
|
||||
}(),
|
||||
R = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver,
|
||||
S = function() {
|
||||
var a;
|
||||
return function() {
|
||||
if (!a) {
|
||||
var b = document.createElement("div");
|
||||
b.style.cssText = "height:10000px;width:1px;", document.body.appendChild(b);
|
||||
var c = document.body.scrollTop;
|
||||
document.documentElement.scrollTop;
|
||||
window.scrollBy(0, 3), a = document.body.scrollTop != c ? document.body : document.documentElement, window.scrollBy(0, -3), document.body.removeChild(b)
|
||||
}
|
||||
return a
|
||||
}
|
||||
}(),
|
||||
V = window.navigator.userAgent,
|
||||
W = /mobile/i.test(V),
|
||||
X = !W;
|
||||
"onwheel" in document.createElement("div") ? Y = "wheel" : "onmousewheel" in document.createElement("div") && (Y = "mousewheel"), Y && X && (H(Y, v), H("mousedown", x), H("load", p)), Z.destroy = q, window.SmoothScrollOptions && Z(window.SmoothScrollOptions), "function" == typeof define && define.amd ? define(function() {
|
||||
return Z
|
||||
}) : "object" == typeof exports ? module.exports = Z : window.SmoothScroll = Z
|
||||
}();
|
||||
+1081
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,69 @@
|
||||
/*!
|
||||
* classie - class helper functions
|
||||
* from bonzo https://github.com/ded/bonzo
|
||||
*
|
||||
* classie.has( elem, 'my-class' ) -> true/false
|
||||
* classie.add( elem, 'my-new-class' )
|
||||
* classie.remove( elem, 'my-unwanted-class' )
|
||||
* classie.toggle( elem, 'my-class' )
|
||||
*/
|
||||
/*jshint browser: true, strict: true, undef: true */
|
||||
/*global define: false */
|
||||
( function( window ) {
|
||||
'use strict';
|
||||
// class helper functions from bonzo https://github.com/ded/bonzo
|
||||
function classReg( className ) {
|
||||
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
|
||||
}
|
||||
// classList support for class management
|
||||
// altho to be fair, the api sucks because it won't accept multiple classes at once
|
||||
var hasClass, addClass, removeClass;
|
||||
if ( 'classList' in document.documentElement ) {
|
||||
hasClass = function( elem, c ) {
|
||||
return elem.classList.contains( c );
|
||||
};
|
||||
addClass = function( elem, c ) {
|
||||
elem.classList.add( c );
|
||||
};
|
||||
removeClass = function( elem, c ) {
|
||||
elem.classList.remove( c );
|
||||
};
|
||||
}
|
||||
else {
|
||||
hasClass = function( elem, c ) {
|
||||
return classReg( c ).test( elem.className );
|
||||
};
|
||||
addClass = function( elem, c ) {
|
||||
if ( !hasClass( elem, c ) ) {
|
||||
elem.className = elem.className + ' ' + c;
|
||||
}
|
||||
};
|
||||
removeClass = function( elem, c ) {
|
||||
elem.className = elem.className.replace( classReg( c ), ' ' );
|
||||
};
|
||||
}
|
||||
function toggleClass( elem, c ) {
|
||||
var fn = hasClass( elem, c ) ? removeClass : addClass;
|
||||
fn( elem, c );
|
||||
}
|
||||
var classie = {
|
||||
// full names
|
||||
hasClass: hasClass,
|
||||
addClass: addClass,
|
||||
removeClass: removeClass,
|
||||
toggleClass: toggleClass,
|
||||
// short names
|
||||
has: hasClass,
|
||||
add: addClass,
|
||||
remove: removeClass,
|
||||
toggle: toggleClass
|
||||
};
|
||||
// transport
|
||||
if ( typeof define === 'function' && define.amd ) {
|
||||
// AMD
|
||||
define( classie );
|
||||
} else {
|
||||
// browser global
|
||||
window.classie = classie;
|
||||
}
|
||||
})( window );
|
||||
@@ -0,0 +1,133 @@
|
||||
;(function ( $, window, undefined ) {
|
||||
|
||||
jQuery(window).load(function(a){
|
||||
contentBoxInit();
|
||||
});
|
||||
jQuery(window).resize(function(a){
|
||||
contentBoxInit();
|
||||
});
|
||||
jQuery(document).ready(function(a) {
|
||||
contentBoxInit();
|
||||
});
|
||||
|
||||
// Content Box - Initialize
|
||||
function contentBoxInit() {
|
||||
$('.ult-content-box').each(function(index, el) {
|
||||
var normal_bg_color = $(el).css('background-color') || '';
|
||||
var normal_border_color = $(el).data('border_color') || 'transparent';
|
||||
var normal_box_shadow = $(el).css('box-shadow') || '';
|
||||
|
||||
var hover_bg_color = $(el).data('hover_bg_color') || $(el).css('background-color');
|
||||
var hover_border_color = $(el).data('hover_border_color') || 'transparent';
|
||||
var hover_box_shadow = $(el).data('hover_box_shadow') || $(el).css('box-shadow');
|
||||
|
||||
$(el).hover(function() {
|
||||
$(el).css('background-color', hover_bg_color);
|
||||
$(el).css('border-color', hover_border_color);
|
||||
$(el).css('box-shadow', hover_box_shadow);
|
||||
}, function() {
|
||||
$(el).css('background-color', normal_bg_color);
|
||||
$(el).css('border-color', normal_border_color);
|
||||
$(el).css('box-shadow', normal_box_shadow);
|
||||
});
|
||||
|
||||
// Margins - Responsive
|
||||
var rm_o = {};
|
||||
var rm = $(el).data('responsive_margins');
|
||||
if(typeof rm != 'undefined' && rm != null) {
|
||||
rm_o = getMargins(rm);
|
||||
}
|
||||
|
||||
// Margins - Normal
|
||||
var nm_o = {};
|
||||
var nm = $(el).data('normal_margins');
|
||||
if(typeof nm != 'undefined' && nm != null ) {
|
||||
nm_o = getMargins(nm);
|
||||
} else {
|
||||
nm_o = getCssMargins(el);
|
||||
}
|
||||
|
||||
var WW = $(window).width() || '';
|
||||
if(WW!='') {
|
||||
if(WW>=768) {
|
||||
//console.log('TRUE >= 768');
|
||||
applyMargins(nm_o, el);
|
||||
} else {
|
||||
//console.log('FALSE not >= 768');
|
||||
applyMargins(rm_o, el);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
// create an object
|
||||
function getCssMargins(el) {
|
||||
var tmOb = {};
|
||||
tmOb['margin-left'] = trimPx($(el).css('margin-left'));
|
||||
tmOb['margin-right'] = trimPx($(el).css('margin-right'));
|
||||
tmOb['margin-top'] = trimPx($(el).css('margin-top'));
|
||||
tmOb['margin-bottom'] = trimPx($(el).css('margin-bottom'));
|
||||
|
||||
// Create normal margins
|
||||
var bs = '';
|
||||
$.each(tmOb, function(index, val) {
|
||||
if(typeof val!= 'undefined' && val != null) {
|
||||
bs += index+':'+val+'px;';
|
||||
}
|
||||
});
|
||||
$(el).attr('data-normal_margins', bs);
|
||||
return tmOb;
|
||||
}
|
||||
// Trim 'px' from margin val
|
||||
function trimPx(l) {
|
||||
var sp;
|
||||
if(typeof l != 'undefined' && l != null) {
|
||||
sp = l.split('px');
|
||||
sp = parseInt(sp[0])
|
||||
}
|
||||
return sp;
|
||||
}
|
||||
|
||||
// Get margins from - DATA ATTRIBUTE
|
||||
// @return object
|
||||
function getMargins(mo) {
|
||||
var tmOj = {};
|
||||
var b = mo.split(';');
|
||||
if(typeof b != 'undefined' && b != null ) {
|
||||
$.each(b, function(index, val) {
|
||||
if(typeof val != undefined && val != null) {
|
||||
var nm = val.split(':');
|
||||
if(typeof nm[0] != undefined && nm[0] != null && typeof nm[1] != undefined && nm[1] != null ) {
|
||||
switch(nm[0]) {
|
||||
case 'margin' : tmOj['margin'] = (nm[1]);
|
||||
break;
|
||||
case 'margin-left' : tmOj['margin-left'] = (nm[1]);
|
||||
break;
|
||||
case 'margin-right' : tmOj['margin-right'] = (nm[1]);
|
||||
break;
|
||||
case 'margin-top' : tmOj['margin-top'] = (nm[1]);
|
||||
break;
|
||||
case 'margin-bottom' : tmOj['margin-bottom'] = (nm[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return tmOj;
|
||||
}
|
||||
|
||||
// Apply css margins from object
|
||||
// @return null
|
||||
function applyMargins(ob, el) {
|
||||
if( !$.isEmptyObject(ob) ) {
|
||||
$.each(ob, function(index, val) {
|
||||
if(typeof val!= 'undefined' && val != null) {
|
||||
$(el).css(index, val);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}(jQuery, window));
|
||||
@@ -0,0 +1,141 @@
|
||||
jQuery(window).load(function(){
|
||||
|
||||
var responsive = function (){
|
||||
|
||||
/**
|
||||
* init variables
|
||||
*/
|
||||
var large_screen = '',
|
||||
desktop = '',
|
||||
tablet = '',
|
||||
tablet_portrait = '',
|
||||
mobile_landscape = '',
|
||||
mobile = '';
|
||||
|
||||
/**
|
||||
* generate responsive @media css
|
||||
*------------------------------------------------------------*/
|
||||
jQuery(".ult-responsive").each(function(index, element) {
|
||||
|
||||
var t = jQuery(element),
|
||||
n = t.attr('data-responsive-json-new'),
|
||||
target = t.data('ultimate-target'),
|
||||
temp_large_screen = '',
|
||||
temp_desktop = '',
|
||||
temp_tablet = '',
|
||||
temp_tablet_portrait = '',
|
||||
temp_mobile_landscape = '',
|
||||
temp_mobile = '';
|
||||
|
||||
if( typeof n != "undefined" || n != null ) {
|
||||
jQuery.each(jQuery.parseJSON(n), function (i, v) {
|
||||
// set css property
|
||||
var css_prop = i;
|
||||
if (typeof v != "undefined" && v != null) {
|
||||
var vals = v.split(";");
|
||||
jQuery.each(vals, function(i, vl) {
|
||||
if (typeof vl != "undefined" || vl != null) {
|
||||
var splitval = vl.split(":");
|
||||
switch(splitval[0]) {
|
||||
case 'large_screen': temp_large_screen += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'desktop': temp_desktop += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'tablet': temp_tablet += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'tablet_portrait': temp_tablet_portrait += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'mobile_landscape':temp_mobile_landscape += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'mobile': temp_mobile += css_prop+":"+splitval[1]+";"; break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(temp_mobile!='') { mobile += target+ '{'+temp_mobile+'}'; }
|
||||
if(temp_mobile_landscape!='') { mobile_landscape += target+ '{'+temp_mobile_landscape+'}'; }
|
||||
if(temp_tablet_portrait!='') { tablet_portrait += target+ '{'+temp_tablet_portrait+'}'; }
|
||||
if(temp_tablet!='') { tablet += target+ '{'+temp_tablet+'}'; }
|
||||
if(temp_desktop!='') { desktop += target+ '{'+temp_desktop+'}'; }
|
||||
if(temp_large_screen!='') { large_screen += target+ '{'+temp_large_screen+'}'; }
|
||||
});
|
||||
|
||||
/*
|
||||
* REMOVE Comments for TESTING
|
||||
*-------------------------------------------*/
|
||||
var UltimateMedia = '<style>\n/** Ultimate: CountDown Responsive **/ ';
|
||||
UltimateMedia += desktop;
|
||||
UltimateMedia += "\n@media (min-width: 1824px) { "+ large_screen +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 1199px) { "+ tablet +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 991px) { "+ tablet_portrait +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 767px) { "+ mobile_landscape +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 479px) { "+ mobile +"\n}";
|
||||
UltimateMedia += '\n/** Ultimate: Tooltipster Responsive - **/</style>';
|
||||
jQuery('head').append(UltimateMedia);
|
||||
|
||||
}
|
||||
responsive();
|
||||
jQuery('.ult_countdown-dateAndTime').each(function(){
|
||||
var t = new Date(jQuery(this).html());
|
||||
var tz = jQuery(this).data('time-zone')*60;
|
||||
var tfrmt = jQuery(this).data('countformat');
|
||||
var labels_new = jQuery(this).data('labels');
|
||||
var new_labels = labels_new.split(",");
|
||||
var labels_new_2 = jQuery(this).data('labels2');
|
||||
var new_labels_2 = labels_new_2.split(",");
|
||||
var server_time = function(){
|
||||
return new Date(jQuery(this).data('time-now'));
|
||||
}
|
||||
|
||||
var ticked = function (a){
|
||||
var json_responsive = jQuery('.ult_countdown-dateAndTime').attr('data-responsive-json-new');
|
||||
var target_responsive = jQuery('.ult_countdown-dateAndTime').attr('data-ultimate-target');
|
||||
var json_responsive_sep = jQuery('.ult_countdown').attr('data-responsive-json-new');
|
||||
var json_target_sep = jQuery('.ult_countdown').attr('data-ultimate-target');
|
||||
jQuery('.ult_countdown-period').addClass('ult-responsive');
|
||||
|
||||
var count_amount = jQuery(this).find('.ult_countdown-amount');
|
||||
var count_period = jQuery(this).find('.ult_countdown-period');
|
||||
|
||||
var tick_color = jQuery(this).data('tick-col'),
|
||||
tick_p_size = jQuery(this).data('tick-p-size'),
|
||||
tick_fontfamily = jQuery(this).data('tick-font-family'),
|
||||
count_amount_css = '',
|
||||
count_amount_font = '',
|
||||
tick_br_color = jQuery(this).data('br-color'),
|
||||
tick_br_size = jQuery(this).data('br-size'),
|
||||
tick_br_style = jQuery(this).data('br-style'),
|
||||
tick_br_radius = jQuery(this).data('br-radius'),
|
||||
tick_bg_color = jQuery(this).data('bg-color'),
|
||||
tick_padd = jQuery(this).data('padd');
|
||||
|
||||
count_amount.attr({
|
||||
'data-ultimate-target': target_responsive,
|
||||
'data-responsive-json-new': json_responsive
|
||||
});
|
||||
count_period.attr({
|
||||
'data-ultimate-target': json_target_sep,
|
||||
'data-responsive-json-new': json_responsive_sep
|
||||
});
|
||||
|
||||
// Added class
|
||||
count_amount.addClass('ult-responsive');
|
||||
|
||||
// Applied CSS for Count Amount & Period
|
||||
count_amount.css({
|
||||
// 'color' : tick_color,
|
||||
'font-family' : tick_fontfamily,
|
||||
'border-width' : tick_br_size,
|
||||
'border-style' : tick_br_style,
|
||||
'border-radius' : tick_br_radius,
|
||||
'background' : tick_bg_color,
|
||||
'padding' : tick_padd,
|
||||
'border-color' : tick_br_color
|
||||
});
|
||||
}
|
||||
|
||||
if(jQuery(this).hasClass('ult-usrtz')){
|
||||
jQuery(this).ult_countdown({labels: new_labels, labels1: new_labels_2, until : t, format: tfrmt, padZeroes:true,onTick:ticked});
|
||||
}else{
|
||||
jQuery(this).ult_countdown({labels: new_labels, labels1: new_labels_2, until : t, format: tfrmt, padZeroes:true,onTick:ticked , serverSync:server_time});
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
countUp.js
|
||||
by @inorganik
|
||||
v 1.1.0
|
||||
*/
|
||||
// target = id of html element or var of previously selected html element where counting occurs
|
||||
// startVal = the value you want to begin at
|
||||
// endVal = the value you want to arrive at
|
||||
// decimals = number of decimal places, default 0
|
||||
// duration = duration of animation in seconds, default 2
|
||||
// options = optional object of options (see below)
|
||||
function countUp(target, startVal, endVal, decimals, duration, options) {
|
||||
// default options
|
||||
this.options = options || {
|
||||
useEasing : true, // toggle easing
|
||||
useGrouping : true, // 1,000,000 vs 1000000
|
||||
separator : ',', // character to use as a separator
|
||||
decimal : '.' // character to use as a decimal
|
||||
}
|
||||
// make sure requestAnimationFrame and cancelAnimationFrame are defined
|
||||
// polyfill for browsers without native support
|
||||
// by Opera engineer Erik Möller
|
||||
var lastTime = 0;
|
||||
var vendors = ['webkit', 'moz', 'ms'];
|
||||
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
||||
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
|
||||
window.cancelAnimationFrame =
|
||||
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
|
||||
}
|
||||
if (!window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame = function(callback, element) {
|
||||
var currTime = new Date().getTime();
|
||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
||||
timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
}
|
||||
}
|
||||
if (!window.cancelAnimationFrame) {
|
||||
window.cancelAnimationFrame = function(id) {
|
||||
clearTimeout(id);
|
||||
}
|
||||
}
|
||||
var self = this;
|
||||
this.d = (typeof target === 'string') ? document.getElementById(target) : target;
|
||||
this.startVal = Number(startVal);
|
||||
this.endVal = Number(endVal);
|
||||
this.countDown = (this.startVal > this.endVal) ? true : false;
|
||||
this.startTime = null;
|
||||
this.timestamp = null;
|
||||
this.remaining = null;
|
||||
this.frameVal = this.startVal;
|
||||
this.rAF = null;
|
||||
this.decimals = Math.max(0, decimals || 0);
|
||||
this.dec = Math.pow(10, this.decimals);
|
||||
this.duration = duration * 1000 || 2000;
|
||||
// Robert Penner's easeOutExpo
|
||||
this.easeOutExpo = function(t, b, c, d) {
|
||||
return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b;
|
||||
}
|
||||
this.count = function(timestamp) {
|
||||
if (self.startTime === null) self.startTime = timestamp;
|
||||
self.timestamp = timestamp;
|
||||
var progress = timestamp - self.startTime;
|
||||
self.remaining = self.duration - progress;
|
||||
// to ease or not to ease
|
||||
if (self.options.useEasing) {
|
||||
if (self.countDown) {
|
||||
var i = self.easeOutExpo(progress, 0, self.startVal - self.endVal, self.duration);
|
||||
self.frameVal = self.startVal - i;
|
||||
} else {
|
||||
self.frameVal = self.easeOutExpo(progress, self.startVal, self.endVal - self.startVal, self.duration);
|
||||
}
|
||||
} else {
|
||||
if (self.countDown) {
|
||||
var i = (self.startVal - self.endVal) * (progress / self.duration);
|
||||
self.frameVal = self.startVal - i;
|
||||
} else {
|
||||
self.frameVal = self.startVal + (self.endVal - self.startVal) * (progress / self.duration);
|
||||
}
|
||||
}
|
||||
// decimal
|
||||
self.frameVal = Math.round(self.frameVal*self.dec)/self.dec;
|
||||
// don't go past endVal since progress can exceed duration in the last frame
|
||||
if (self.countDown) {
|
||||
self.frameVal = (self.frameVal < self.endVal) ? self.endVal : self.frameVal;
|
||||
} else {
|
||||
self.frameVal = (self.frameVal > self.endVal) ? self.endVal : self.frameVal;
|
||||
}
|
||||
// format and print value
|
||||
self.d.innerHTML = self.formatNumber(self.frameVal.toFixed(self.decimals));
|
||||
// whether to continue
|
||||
if (progress < self.duration) {
|
||||
self.rAF = requestAnimationFrame(self.count);
|
||||
} else {
|
||||
if (self.callback != null) self.callback();
|
||||
}
|
||||
}
|
||||
this.start = function(callback) {
|
||||
self.callback = callback;
|
||||
// make sure values are valid
|
||||
if (!isNaN(self.endVal) && !isNaN(self.startVal)) {
|
||||
self.rAF = requestAnimationFrame(self.count);
|
||||
} else {
|
||||
console.log('countUp error: startVal or endVal is not a number');
|
||||
self.d.innerHTML = '--';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
this.stop = function() {
|
||||
cancelAnimationFrame(self.rAF);
|
||||
}
|
||||
this.reset = function() {
|
||||
self.startTime = null;
|
||||
cancelAnimationFrame(self.rAF);
|
||||
self.d.innerHTML = self.formatNumber(self.startVal.toFixed(self.decimals));
|
||||
}
|
||||
this.resume = function() {
|
||||
self.startTime = null;
|
||||
self.duration = self.remaining;
|
||||
self.startVal = self.frameVal;
|
||||
requestAnimationFrame(self.count);
|
||||
}
|
||||
this.formatNumber = function(nStr) {
|
||||
nStr += '';
|
||||
var x, x1, x2, rgx;
|
||||
x = nStr.split('.');
|
||||
x1 = x[0];
|
||||
x2 = x.length > 1 ? self.options.decimal + x[1] : '';
|
||||
rgx = /(\d+)(\d{3})/;
|
||||
if (self.options.useGrouping) {
|
||||
while (rgx.test(x1)) {
|
||||
x1 = x1.replace(rgx, '$1' + self.options.separator + '$2');
|
||||
}
|
||||
}
|
||||
return x1 + x2;
|
||||
}
|
||||
// format startVal on initialization
|
||||
self.d.innerHTML = self.formatNumber(self.startVal.toFixed(self.decimals));
|
||||
}
|
||||
// Example:
|
||||
// var numAnim = new countUp("SomeElementYouWantToAnimate", 0, 99.99, 2, 2.5);
|
||||
// numAnim.start();
|
||||
// with optional callback:
|
||||
// numAnim.start(someMethodToCallOnComplete);
|
||||
@@ -0,0 +1,816 @@
|
||||
(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a)};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Countdown for jQuery v2.0.0.
|
||||
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
|
||||
Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
|
||||
Please attribute the author if you use it. */
|
||||
(function($) { // Hide scope, no $ conflict
|
||||
var pluginName = 'ult_countdown';
|
||||
var Y = 0; // Years
|
||||
var O = 1; // Months
|
||||
var W = 2; // Weeks
|
||||
var D = 3; // Days
|
||||
var H = 4; // Hours
|
||||
var M = 5; // Minutes
|
||||
var S = 6; // Seconds
|
||||
/** Create the countdown plugin.
|
||||
<p>Sets an element to show the time remaining until a given instant.</p>
|
||||
<p>Expects HTML like:</p>
|
||||
<pre><div></div></pre>
|
||||
<p>Provide inline configuration like:</p>
|
||||
<pre><div data-countdown="name: 'value'"></div></pre>
|
||||
@module Countdown
|
||||
@augments JQPlugin
|
||||
@example $(selector).countdown({until: +300}) */
|
||||
$.JQPlugin.createPlugin({
|
||||
/** The name of the plugin. */
|
||||
name: pluginName,
|
||||
/** Countdown expiry callback.
|
||||
Triggered when the countdown expires.
|
||||
@callback expiryCallback */
|
||||
/** Countdown server synchronisation callback.
|
||||
Triggered when the countdown is initialised.
|
||||
@callback serverSyncCallback
|
||||
@return {Date} The current date/time on the server as expressed in the local timezone. */
|
||||
/** Countdown tick callback.
|
||||
Triggered on every <code>tickInterval</code> ticks of the countdown.
|
||||
@callback tickCallback
|
||||
@param periods {number[]} The breakdown by period (years, months, weeks, days,
|
||||
hours, minutes, seconds) of the time remaining/passed. */
|
||||
/** Countdown which labels callback.
|
||||
Triggered when the countdown is being display to determine which set of labels
|
||||
(<code>labels</code>, <code>labels1</code>, ...) are to be used for the current period value.
|
||||
@callback whichLabelsCallback
|
||||
@param num {number} The current period value.
|
||||
@return {number} The suffix for the label set to use. */
|
||||
/** Default settings for the plugin.
|
||||
@property until {Date|number|string} The date/time to count down to, or number of seconds
|
||||
offset from now, or string of amounts and units for offset(s) from now:
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
@example until: new Date(2013, 12-1, 25, 13, 30)
|
||||
until: +300
|
||||
until: '+1O -2D'
|
||||
@property [since] {Date|number|string} The date/time to count up from, or
|
||||
number of seconds offset from now, or string for unit offset(s):
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
@example since: new Date(2013, 1-1, 1)
|
||||
since: -300
|
||||
since: '-1O +2D'
|
||||
@property [timezone=null] {number} The timezone (hours or minutes from GMT) for the target times,
|
||||
or null for client local timezone.
|
||||
@example timezone: +10
|
||||
timezone: -60
|
||||
@property [serverSync=null] {serverSyncCallback} A function to retrieve the current server time
|
||||
for synchronisation.
|
||||
@property [format='dHMS'] {string} The format for display - upper case for always, lower case only if non-zero,
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
@property [layout=''] {string} Build your own layout for the countdown.
|
||||
@example layout: '{d<}{dn} {dl}{d>} {hnn}:{mnn}:{snn}'
|
||||
@property [compact=false] {boolean} True to display in a compact format, false for an expanded one.
|
||||
@property [padZeroes=false] {boolean} True to add leading zeroes
|
||||
@property [significant=0] {number} The number of periods with non-zero values to show, zero for all.
|
||||
@property [description=''] {string} The description displayed for the countdown.
|
||||
@property [expiryUrl=''] {string} A URL to load upon expiry, replacing the current page.
|
||||
@property [expiryText=''] {string} Text to display upon expiry, replacing the countdown. This may be HTML.
|
||||
@property [alwaysExpire=false] {boolean} True to trigger <code>onExpiry</code> even if target time has passed.
|
||||
@property [onExpiry=null] {expiryCallback} Callback when the countdown expires -
|
||||
receives no parameters and <code>this</code> is the containing division.
|
||||
@example onExpiry: function() {
|
||||
...
|
||||
}
|
||||
@property [onTick=null] {tickCallback} Callback when the countdown is updated -
|
||||
receives <code>number[7]</code> being the breakdown by period
|
||||
(years, months, weeks, days, hours, minutes, seconds - based on
|
||||
<code>format</code>) and <code>this</code> is the containing division.
|
||||
@example onTick: function(periods) {
|
||||
var secs = $.countdown.periodsToSeconds(periods);
|
||||
if (secs < 300) { // Last five minutes
|
||||
...
|
||||
}
|
||||
}
|
||||
@property [tickInterval=1] {number} The interval (seconds) between <code>onTick</code> callbacks. */
|
||||
defaultOptions: {
|
||||
until: null,
|
||||
since: null,
|
||||
timezone: null,
|
||||
serverSync: null,
|
||||
format: 'dHMS',
|
||||
layout: '',
|
||||
compact: false,
|
||||
padZeroes: false,
|
||||
significant: 0,
|
||||
description: '',
|
||||
expiryUrl: '',
|
||||
expiryText: '',
|
||||
alwaysExpire: false,
|
||||
onExpiry: null,
|
||||
onTick: null,
|
||||
tickInterval: 1
|
||||
},
|
||||
/** Localisations for the plugin.
|
||||
Entries are objects indexed by the language code ('' being the default US/English).
|
||||
Each object has the following attributes.
|
||||
@property [labels=['Years','Months','Weeks','Days','Hours','Minutes','Seconds']] {string[]}
|
||||
The display texts for the counter periods.
|
||||
@property [labels1=['Year','Month','Week','Day','Hour','Minute','Second']] {string[]}
|
||||
The display texts for the counter periods if they have a value of 1.
|
||||
Add other <code>labels<em>n</em></code> attributes as necessary to
|
||||
cater for other numeric idiosyncrasies of the localisation.
|
||||
@property [compactLabels=['y','m','w','d']] {string[]} The compact texts for the counter periods.
|
||||
@property [whichLabels=null] {whichLabelsCallback} A function to determine which
|
||||
<code>labels<em>n</em></code> to use.
|
||||
@example whichLabels: function(num) {
|
||||
return (num > 1 ? 0 : 1);
|
||||
}
|
||||
@property [digits=['0','1',...,'9']] {number[]} The digits to display (0-9).
|
||||
@property [timeSeparator=':'] {string} Separator for time periods in the compact layout.
|
||||
@property [isRTL=false] {boolean} True for right-to-left languages, false for left-to-right. */
|
||||
regionalOptions: { // Available regional settings, indexed by language/country code
|
||||
'': { // Default regional settings - English/US
|
||||
labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
|
||||
labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
|
||||
compactLabels: ['y', 'm', 'w', 'd'],
|
||||
whichLabels: null,
|
||||
digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
}
|
||||
},
|
||||
/** Names of getter methods - those that can't be chained. */
|
||||
_getters: ['getTimes'],
|
||||
/* Class name for the right-to-left marker. */
|
||||
_rtlClass: pluginName + '-rtl',
|
||||
/* Class name for the countdown section marker. */
|
||||
_sectionClass: pluginName + '-section',
|
||||
/* Class name for the period amount marker. */
|
||||
_amountClass: pluginName + '-amount',
|
||||
/* Class name for the period name marker. */
|
||||
_periodClass: pluginName + '-period',
|
||||
/* Class name for the countdown row marker. */
|
||||
_rowClass: pluginName + '-row',
|
||||
/* Class name for the holding countdown marker. */
|
||||
_holdingClass: pluginName + '-holding',
|
||||
/* Class name for the showing countdown marker. */
|
||||
_showClass: pluginName + '-show',
|
||||
/* Class name for the description marker. */
|
||||
_descrClass: pluginName + '-descr',
|
||||
/* List of currently active countdown elements. */
|
||||
_timerElems: [],
|
||||
/** Additional setup for the countdown.
|
||||
Apply default localisations.
|
||||
Create the timer. */
|
||||
_init: function() {
|
||||
var self = this;
|
||||
this._super();
|
||||
this._serverSyncs = [];
|
||||
var now = (typeof Date.now == 'function' ? Date.now :
|
||||
function() { return new Date().getTime(); });
|
||||
var perfAvail = (window.performance && typeof window.performance.now == 'function');
|
||||
// Shared timer for all countdowns
|
||||
function timerCallBack(timestamp) {
|
||||
var drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer
|
||||
(perfAvail ? (performance.now() + performance.timing.navigationStart) : now()) :
|
||||
// Integer milliseconds since unix epoch
|
||||
timestamp || now());
|
||||
if (drawStart - animationStartTime >= 1000) {
|
||||
self._updateElems();
|
||||
animationStartTime = drawStart;
|
||||
}
|
||||
requestAnimationFrame(timerCallBack);
|
||||
}
|
||||
var requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame || window.msRequestAnimationFrame || null;
|
||||
// This is when we expect a fall-back to setInterval as it's much more fluid
|
||||
var animationStartTime = 0;
|
||||
if (!requestAnimationFrame || $.noRequestAnimationFrame) {
|
||||
$.noRequestAnimationFrame = null;
|
||||
setInterval(function() { self._updateElems(); }, 980); // Fall back to good old setInterval
|
||||
}
|
||||
else {
|
||||
animationStartTime = window.animationStartTime ||
|
||||
window.webkitAnimationStartTime || window.mozAnimationStartTime ||
|
||||
window.oAnimationStartTime || window.msAnimationStartTime || now();
|
||||
requestAnimationFrame(timerCallBack);
|
||||
}
|
||||
},
|
||||
/** Convert a date/time to UTC.
|
||||
@param tz {number} The hour or minute offset from GMT, e.g. +9, -360.
|
||||
@param year {Date|number} the date/time in that timezone or the year in that timezone.
|
||||
@param [month] {number} The month (0 - 11) (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param [day] {number} The day (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param [hours] {number} The hour (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param [mins] {number} The minute (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param [secs] {number} The second (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param [ms] {number} The millisecond (omit if <code>year</code> is a <code>Date</code>).
|
||||
@return {Date} The equivalent UTC date/time.
|
||||
@example $.countdown.UTCDate(+10, 2013, 12-1, 25, 12, 0)
|
||||
$.countdown.UTCDate(-7, new Date(2013, 12-1, 25, 12, 0)) */
|
||||
UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
|
||||
if (typeof year == 'object' && year.constructor == Date) {
|
||||
ms = year.getMilliseconds();
|
||||
secs = year.getSeconds();
|
||||
mins = year.getMinutes();
|
||||
hours = year.getHours();
|
||||
day = year.getDate();
|
||||
month = year.getMonth();
|
||||
year = year.getFullYear();
|
||||
}
|
||||
var d = new Date();
|
||||
d.setUTCFullYear(year);
|
||||
d.setUTCDate(1);
|
||||
d.setUTCMonth(month || 0);
|
||||
d.setUTCDate(day || 1);
|
||||
d.setUTCHours(hours || 0);
|
||||
d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
|
||||
d.setUTCSeconds(secs || 0);
|
||||
d.setUTCMilliseconds(ms || 0);
|
||||
return d;
|
||||
},
|
||||
/** Convert a set of periods into seconds.
|
||||
Averaged for months and years.
|
||||
@param periods {number[]} The periods per year/month/week/day/hour/minute/second.
|
||||
@return {number} The corresponding number of seconds.
|
||||
@example var secs = $.countdown.periodsToSeconds(periods) */
|
||||
periodsToSeconds: function(periods) {
|
||||
return periods[0] * 31557600 + periods[1] * 2629800 + periods[2] * 604800 +
|
||||
periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
|
||||
},
|
||||
_instSettings: function(elem, options) {
|
||||
return {_periods: [0, 0, 0, 0, 0, 0, 0]};
|
||||
},
|
||||
/** Add an element to the list of active ones.
|
||||
@private
|
||||
@param elem {Element} The countdown element. */
|
||||
_addElem: function(elem) {
|
||||
if (!this._hasElem(elem)) {
|
||||
this._timerElems.push(elem);
|
||||
}
|
||||
},
|
||||
/** See if an element is in the list of active ones.
|
||||
@private
|
||||
@param elem {Element} The countdown element.
|
||||
@return {boolean} True if present, false if not. */
|
||||
_hasElem: function(elem) {
|
||||
return ($.inArray(elem, this._timerElems) > -1);
|
||||
},
|
||||
/** Remove an element from the list of active ones.
|
||||
@private
|
||||
@param elem {Element} The countdown element. */
|
||||
_removeElem: function(elem) {
|
||||
this._timerElems = $.map(this._timerElems,
|
||||
function(value) { return (value == elem ? null : value); }); // delete entry
|
||||
},
|
||||
/** Update each active timer element.
|
||||
@private */
|
||||
_updateElems: function() {
|
||||
for (var i = this._timerElems.length - 1; i >= 0; i--) {
|
||||
this._updateCountdown(this._timerElems[i]);
|
||||
}
|
||||
},
|
||||
_optionsChanged: function(elem, inst, options) {
|
||||
if (options.layout) {
|
||||
options.layout = options.layout.replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
this._resetExtraLabels(inst.options, options);
|
||||
var timezoneChanged = (inst.options.timezone != options.timezone);
|
||||
$.extend(inst.options, options);
|
||||
this._adjustSettings(elem, inst,
|
||||
options.until != null || options.since != null || timezoneChanged);
|
||||
var now = new Date();
|
||||
if ((inst._since && inst._since < now) || (inst._until && inst._until > now)) {
|
||||
this._addElem(elem[0]);
|
||||
}
|
||||
this._updateCountdown(elem, inst);
|
||||
},
|
||||
/** Redisplay the countdown with an updated display.
|
||||
@private
|
||||
@param elem {Element|jQuery} The containing division.
|
||||
@param inst {object} The current settings for this instance. */
|
||||
_updateCountdown: function(elem, inst) {
|
||||
elem = elem.jquery ? elem : $(elem);
|
||||
inst = inst || elem.data(this.name);
|
||||
if (!inst) {
|
||||
return;
|
||||
}
|
||||
elem.html(this._generateHTML(inst)).toggleClass(this._rtlClass, inst.options.isRTL);
|
||||
if ($.isFunction(inst.options.onTick)) {
|
||||
var periods = inst._hold != 'lap' ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date());
|
||||
if (inst.options.tickInterval == 1 ||
|
||||
this.periodsToSeconds(periods) % inst.options.tickInterval == 0) {
|
||||
inst.options.onTick.apply(elem[0], [periods]);
|
||||
}
|
||||
}
|
||||
var expired = inst._hold != 'pause' &&
|
||||
(inst._since ? inst._now.getTime() < inst._since.getTime() :
|
||||
inst._now.getTime() >= inst._until.getTime());
|
||||
if (expired && !inst._expiring) {
|
||||
inst._expiring = true;
|
||||
if (this._hasElem(elem[0]) || inst.options.alwaysExpire) {
|
||||
this._removeElem(elem[0]);
|
||||
if ($.isFunction(inst.options.onExpiry)) {
|
||||
inst.options.onExpiry.apply(elem[0], []);
|
||||
}
|
||||
if (inst.options.expiryText) {
|
||||
var layout = inst.options.layout;
|
||||
inst.options.layout = inst.options.expiryText;
|
||||
this._updateCountdown(elem[0], inst);
|
||||
inst.options.layout = layout;
|
||||
}
|
||||
if (inst.options.expiryUrl) {
|
||||
window.location = inst.options.expiryUrl;
|
||||
}
|
||||
}
|
||||
inst._expiring = false;
|
||||
}
|
||||
else if (inst._hold == 'pause') {
|
||||
this._removeElem(elem[0]);
|
||||
}
|
||||
},
|
||||
/** Reset any extra labelsn and compactLabelsn entries if changing labels.
|
||||
@private
|
||||
@param base {object} The options to be updated.
|
||||
@param options {object} The new option values. */
|
||||
_resetExtraLabels: function(base, options) {
|
||||
var changingLabels = false;
|
||||
for (var n in options) {
|
||||
if (n != 'whichLabels' && n.match(/[Ll]abels/)) {
|
||||
changingLabels = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (changingLabels) {
|
||||
for (var n in base) { // Remove custom numbered labels
|
||||
if (n.match(/[Ll]abels[02-9]|compactLabels1/)) {
|
||||
base[n] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/** Calculate internal settings for an instance.
|
||||
@private
|
||||
@param elem {jQuery} The containing division.
|
||||
@param inst {object} The current settings for this instance.
|
||||
@param recalc {boolean} True if until or since are set. */
|
||||
_adjustSettings: function(elem, inst, recalc) {
|
||||
var now;
|
||||
var serverOffset = 0;
|
||||
var serverEntry = null;
|
||||
for (var i = 0; i < this._serverSyncs.length; i++) {
|
||||
if (this._serverSyncs[i][0] == inst.options.serverSync) {
|
||||
serverEntry = this._serverSyncs[i][1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (serverEntry != null) {
|
||||
serverOffset = (inst.options.serverSync ? serverEntry : 0);
|
||||
now = new Date();
|
||||
}
|
||||
else {
|
||||
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
||||
inst.options.serverSync.apply(elem[0], []) : null);
|
||||
now = new Date();
|
||||
serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
|
||||
this._serverSyncs.push([inst.options.serverSync, serverOffset]);
|
||||
}
|
||||
var timezone = inst.options.timezone;
|
||||
timezone = (timezone == null ? -now.getTimezoneOffset() : timezone);
|
||||
if (recalc || (!recalc && inst._until == null && inst._since == null)) {
|
||||
inst._since = inst.options.since;
|
||||
if (inst._since != null) {
|
||||
inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
|
||||
if (inst._since && serverOffset) {
|
||||
inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
|
||||
}
|
||||
}
|
||||
inst._until = this.UTCDate(timezone, this._determineTime(inst.options.until, now));
|
||||
if (serverOffset) {
|
||||
inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
|
||||
}
|
||||
}
|
||||
inst._show = this._determineShow(inst);
|
||||
},
|
||||
/** Remove the countdown widget from a div.
|
||||
@param elem {jQuery} The containing division.
|
||||
@param inst {object} The current instance object. */
|
||||
_preDestroy: function(elem, inst) {
|
||||
this._removeElem(elem[0]);
|
||||
elem.empty();
|
||||
},
|
||||
/** Pause a countdown widget at the current time.
|
||||
Stop it running but remember and display the current time.
|
||||
@param elem {Element} The containing division.
|
||||
@example $(selector).countdown('pause') */
|
||||
pause: function(elem) {
|
||||
this._hold(elem, 'pause');
|
||||
},
|
||||
/** Pause a countdown widget at the current time.
|
||||
Stop the display but keep the countdown running.
|
||||
@param elem {Element} The containing division.
|
||||
@example $(selector).countdown('lap') */
|
||||
lap: function(elem) {
|
||||
this._hold(elem, 'lap');
|
||||
},
|
||||
/** Resume a paused countdown widget.
|
||||
@param elem {Element} The containing division.
|
||||
@example $(selector).countdown('resume') */
|
||||
resume: function(elem) {
|
||||
this._hold(elem, null);
|
||||
},
|
||||
/** Toggle a paused countdown widget.
|
||||
@param elem {Element} The containing division.
|
||||
@example $(selector).countdown('toggle') */
|
||||
toggle: function(elem) {
|
||||
var inst = $.data(elem, this.name) || {};
|
||||
this[!inst._hold ? 'pause' : 'resume'](elem);
|
||||
},
|
||||
/** Toggle a lapped countdown widget.
|
||||
@param elem {Element} The containing division.
|
||||
@example $(selector).countdown('toggleLap') */
|
||||
toggleLap: function(elem) {
|
||||
var inst = $.data(elem, this.name) || {};
|
||||
this[!inst._hold ? 'lap' : 'resume'](elem);
|
||||
},
|
||||
/** Pause or resume a countdown widget.
|
||||
@private
|
||||
@param elem {Element} The containing division.
|
||||
@param hold {string} The new hold setting. */
|
||||
_hold: function(elem, hold) {
|
||||
var inst = $.data(elem, this.name);
|
||||
if (inst) {
|
||||
if (inst._hold == 'pause' && !hold) {
|
||||
inst._periods = inst._savePeriods;
|
||||
var sign = (inst._since ? '-' : '+');
|
||||
inst[inst._since ? '_since' : '_until'] =
|
||||
this._determineTime(sign + inst._periods[0] + 'y' +
|
||||
sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
|
||||
sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' +
|
||||
sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
|
||||
this._addElem(elem);
|
||||
}
|
||||
inst._hold = hold;
|
||||
inst._savePeriods = (hold == 'pause' ? inst._periods : null);
|
||||
$.data(elem, this.name, inst);
|
||||
this._updateCountdown(elem, inst);
|
||||
}
|
||||
},
|
||||
/** Return the current time periods.
|
||||
@param elem {Element} The containing division.
|
||||
@return {number[]} The current periods for the countdown.
|
||||
@example var periods = $(selector).countdown('getTimes') */
|
||||
getTimes: function(elem) {
|
||||
var inst = $.data(elem, this.name);
|
||||
return (!inst ? null : (inst._hold == 'pause' ? inst._savePeriods : (!inst._hold ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()))));
|
||||
},
|
||||
/** A time may be specified as an exact value or a relative one.
|
||||
@private
|
||||
@param setting {string|number|Date} The date/time value as a relative or absolute value.
|
||||
@param defaultTime {Date} The date/time to use if no other is supplied.
|
||||
@return {Date} The corresponding date/time. */
|
||||
_determineTime: function(setting, defaultTime) {
|
||||
var self = this;
|
||||
var offsetNumeric = function(offset) { // e.g. +300, -2
|
||||
var time = new Date();
|
||||
time.setTime(time.getTime() + offset * 1000);
|
||||
return time;
|
||||
};
|
||||
var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
|
||||
offset = offset.toLowerCase();
|
||||
var time = new Date();
|
||||
var year = time.getFullYear();
|
||||
var month = time.getMonth();
|
||||
var day = time.getDate();
|
||||
var hour = time.getHours();
|
||||
var minute = time.getMinutes();
|
||||
var second = time.getSeconds();
|
||||
var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
|
||||
var matches = pattern.exec(offset);
|
||||
while (matches) {
|
||||
switch (matches[2] || 's') {
|
||||
case 's': second += parseInt(matches[1], 10); break;
|
||||
case 'm': minute += parseInt(matches[1], 10); break;
|
||||
case 'h': hour += parseInt(matches[1], 10); break;
|
||||
case 'd': day += parseInt(matches[1], 10); break;
|
||||
case 'w': day += parseInt(matches[1], 10) * 7; break;
|
||||
case 'o':
|
||||
month += parseInt(matches[1], 10);
|
||||
day = Math.min(day, self._getDaysInMonth(year, month));
|
||||
break;
|
||||
case 'y':
|
||||
year += parseInt(matches[1], 10);
|
||||
day = Math.min(day, self._getDaysInMonth(year, month));
|
||||
break;
|
||||
}
|
||||
matches = pattern.exec(offset);
|
||||
}
|
||||
return new Date(year, month, day, hour, minute, second, 0);
|
||||
};
|
||||
var time = (setting == null ? defaultTime :
|
||||
(typeof setting == 'string' ? offsetString(setting) :
|
||||
(typeof setting == 'number' ? offsetNumeric(setting) : setting)));
|
||||
if (time) time.setMilliseconds(0);
|
||||
return time;
|
||||
},
|
||||
/** Determine the number of days in a month.
|
||||
@private
|
||||
@param year {number} The year.
|
||||
@param month {number} The month.
|
||||
@return {number} The days in that month. */
|
||||
_getDaysInMonth: function(year, month) {
|
||||
return 32 - new Date(year, month, 32).getDate();
|
||||
},
|
||||
/** Default implementation to determine which set of labels should be used for an amount.
|
||||
Use the <code>labels</code> attribute with the same numeric suffix (if it exists).
|
||||
@private
|
||||
@param num {number} The amount to be displayed.
|
||||
@return {number} The set of labels to be used for this amount. */
|
||||
_normalLabels: function(num) {
|
||||
return num;
|
||||
},
|
||||
/** Generate the HTML to display the countdown widget.
|
||||
@private
|
||||
@param inst {object} The current settings for this instance.
|
||||
@return {string} The new HTML for the countdown display. */
|
||||
_generateHTML: function(inst) {
|
||||
var self = this;
|
||||
// Determine what to show
|
||||
inst._periods = (inst._hold ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()));
|
||||
// Show all 'asNeeded' after first non-zero value
|
||||
var shownNonZero = false;
|
||||
var showCount = 0;
|
||||
var sigCount = inst.options.significant;
|
||||
var show = $.extend({}, inst._show);
|
||||
for (var period = Y; period <= S; period++) {
|
||||
shownNonZero |= (inst._show[period] == '?' && inst._periods[period] > 0);
|
||||
show[period] = (inst._show[period] == '?' && !shownNonZero ? null : inst._show[period]);
|
||||
showCount += (show[period] ? 1 : 0);
|
||||
sigCount -= (inst._periods[period] > 0 ? 1 : 0);
|
||||
}
|
||||
var showSignificant = [false, false, false, false, false, false, false];
|
||||
for (var period = S; period >= Y; period--) { // Determine significant periods
|
||||
if (inst._show[period]) {
|
||||
if (inst._periods[period]) {
|
||||
showSignificant[period] = true;
|
||||
}
|
||||
else {
|
||||
showSignificant[period] = sigCount > 0;
|
||||
sigCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
var labels = (inst.options.compact ? inst.options.compactLabels : inst.options.labels);
|
||||
var whichLabels = inst.options.whichLabels || this._normalLabels;
|
||||
var showCompact = function(period) {
|
||||
var labelsNum = inst.options['compactLabels' + whichLabels(inst._periods[period])];
|
||||
return (show[period] ? self._translateDigits(inst, inst._periods[period]) +
|
||||
(labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
|
||||
};
|
||||
var minDigits = (inst.options.padZeroes ? 2 : 1);
|
||||
var showFull = function(period) {
|
||||
var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])];
|
||||
return ((!inst.options.significant && show[period]) ||
|
||||
(inst.options.significant && showSignificant[period]) ?
|
||||
'<span class="' + self._sectionClass + '">' +
|
||||
//SID EDIT
|
||||
'<span class="ult_time-mid">' +
|
||||
'<span class="' + self._amountClass + '">' +
|
||||
self._minDigits(inst, inst._periods[period], minDigits) + '</span>' +
|
||||
'<span class="' + self._periodClass + '">' +
|
||||
(labelsNum ? labelsNum[period] : labels[period]) + '</span></span></span>' : '');
|
||||
};
|
||||
return (inst.options.layout ? this._buildLayout(inst, show, inst.options.layout,
|
||||
inst.options.compact, inst.options.significant, showSignificant) :
|
||||
((inst.options.compact ? // Compact version
|
||||
'<span class="' + this._rowClass + ' ' + this._amountClass +
|
||||
(inst._hold ? ' ' + this._holdingClass : '') + '">' +
|
||||
showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) +
|
||||
(show[H] ? this._minDigits(inst, inst._periods[H], 2) : '') +
|
||||
(show[M] ? (show[H] ? inst.options.timeSeparator : '') +
|
||||
this._minDigits(inst, inst._periods[M], 2) : '') +
|
||||
(show[S] ? (show[H] || show[M] ? inst.options.timeSeparator : '') +
|
||||
this._minDigits(inst, inst._periods[S], 2) : '') :
|
||||
// Full version
|
||||
'<span class="' + this._rowClass + ' ' + this._showClass + (inst.options.significant || showCount) +
|
||||
(inst._hold ? ' ' + this._holdingClass : '') + '">' +
|
||||
showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
|
||||
showFull(H) + showFull(M) + showFull(S)) + '</span>' +
|
||||
(inst.options.description ? '<span class="' + this._rowClass + ' ' + this._descrClass + '">' +
|
||||
inst.options.description + '</span>' : '')));
|
||||
},
|
||||
/** Construct a custom layout.
|
||||
@private
|
||||
@param inst {object} The current settings for this instance.
|
||||
@param show {boolean[]} Flags indicating which periods are requested.
|
||||
@param layout {string} The customised layout.
|
||||
@param compact {boolean} True if using compact labels.
|
||||
@param significant {number} The number of periods with values to show, zero for all.
|
||||
@param showSignificant {boolean[]} Other periods to show for significance.
|
||||
@return {string} The custom HTML. */
|
||||
_buildLayout: function(inst, show, layout, compact, significant, showSignificant) {
|
||||
var labels = inst.options[compact ? 'compactLabels' : 'labels'];
|
||||
var whichLabels = inst.options.whichLabels || this._normalLabels;
|
||||
var labelFor = function(index) {
|
||||
return (inst.options[(compact ? 'compactLabels' : 'labels') +
|
||||
whichLabels(inst._periods[index])] || labels)[index];
|
||||
};
|
||||
var digit = function(value, position) {
|
||||
return inst.options.digits[Math.floor(value / position) % 10];
|
||||
};
|
||||
var subs = {desc: inst.options.description, sep: inst.options.timeSeparator,
|
||||
yl: labelFor(Y), yn: this._minDigits(inst, inst._periods[Y], 1),
|
||||
ynn: this._minDigits(inst, inst._periods[Y], 2),
|
||||
ynnn: this._minDigits(inst, inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
|
||||
y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
|
||||
y1000: digit(inst._periods[Y], 1000),
|
||||
ol: labelFor(O), on: this._minDigits(inst, inst._periods[O], 1),
|
||||
onn: this._minDigits(inst, inst._periods[O], 2),
|
||||
onnn: this._minDigits(inst, inst._periods[O], 3), o1: digit(inst._periods[O], 1),
|
||||
o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
|
||||
o1000: digit(inst._periods[O], 1000),
|
||||
wl: labelFor(W), wn: this._minDigits(inst, inst._periods[W], 1),
|
||||
wnn: this._minDigits(inst, inst._periods[W], 2),
|
||||
wnnn: this._minDigits(inst, inst._periods[W], 3), w1: digit(inst._periods[W], 1),
|
||||
w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
|
||||
w1000: digit(inst._periods[W], 1000),
|
||||
dl: labelFor(D), dn: this._minDigits(inst, inst._periods[D], 1),
|
||||
dnn: this._minDigits(inst, inst._periods[D], 2),
|
||||
dnnn: this._minDigits(inst, inst._periods[D], 3), d1: digit(inst._periods[D], 1),
|
||||
d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
|
||||
d1000: digit(inst._periods[D], 1000),
|
||||
hl: labelFor(H), hn: this._minDigits(inst, inst._periods[H], 1),
|
||||
hnn: this._minDigits(inst, inst._periods[H], 2),
|
||||
hnnn: this._minDigits(inst, inst._periods[H], 3), h1: digit(inst._periods[H], 1),
|
||||
h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
|
||||
h1000: digit(inst._periods[H], 1000),
|
||||
ml: labelFor(M), mn: this._minDigits(inst, inst._periods[M], 1),
|
||||
mnn: this._minDigits(inst, inst._periods[M], 2),
|
||||
mnnn: this._minDigits(inst, inst._periods[M], 3), m1: digit(inst._periods[M], 1),
|
||||
m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
|
||||
m1000: digit(inst._periods[M], 1000),
|
||||
sl: labelFor(S), sn: this._minDigits(inst, inst._periods[S], 1),
|
||||
snn: this._minDigits(inst, inst._periods[S], 2),
|
||||
snnn: this._minDigits(inst, inst._periods[S], 3), s1: digit(inst._periods[S], 1),
|
||||
s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100),
|
||||
s1000: digit(inst._periods[S], 1000)};
|
||||
var html = layout;
|
||||
// Replace period containers: {p<}...{p>}
|
||||
for (var i = Y; i <= S; i++) {
|
||||
var period = 'yowdhms'.charAt(i);
|
||||
var re = new RegExp('\\{' + period + '<\\}([\\s\\S]*)\\{' + period + '>\\}', 'g');
|
||||
html = html.replace(re, ((!significant && show[i]) ||
|
||||
(significant && showSignificant[i]) ? '$1' : ''));
|
||||
}
|
||||
// Replace period values: {pn}
|
||||
$.each(subs, function(n, v) {
|
||||
var re = new RegExp('\\{' + n + '\\}', 'g');
|
||||
html = html.replace(re, v);
|
||||
});
|
||||
return html;
|
||||
},
|
||||
/** Ensure a numeric value has at least n digits for display.
|
||||
@private
|
||||
@param inst {object} The current settings for this instance.
|
||||
@param value {number} The value to display.
|
||||
@param len {number} The minimum length.
|
||||
@return {string} The display text. */
|
||||
_minDigits: function(inst, value, len) {
|
||||
value = '' + value;
|
||||
if (value.length >= len) {
|
||||
return this._translateDigits(inst, value);
|
||||
}
|
||||
value = '0000000000' + value;
|
||||
return this._translateDigits(inst, value.substr(value.length - len));
|
||||
},
|
||||
/** Translate digits into other representations.
|
||||
@private
|
||||
@param inst {object} The current settings for this instance.
|
||||
@param value {string} The text to translate.
|
||||
@return {string} The translated text. */
|
||||
_translateDigits: function(inst, value) {
|
||||
return ('' + value).replace(/[0-9]/g, function(digit) {
|
||||
return inst.options.digits[digit];
|
||||
});
|
||||
},
|
||||
/** Translate the format into flags for each period.
|
||||
@private
|
||||
@param inst {object} The current settings for this instance.
|
||||
@return {string[]} Flags indicating which periods are requested (?) or
|
||||
required (!) by year, month, week, day, hour, minute, second. */
|
||||
_determineShow: function(inst) {
|
||||
var format = inst.options.format;
|
||||
var show = [];
|
||||
show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
|
||||
show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
|
||||
show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
|
||||
show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
|
||||
show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
|
||||
show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
|
||||
show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
|
||||
return show;
|
||||
},
|
||||
/** Calculate the requested periods between now and the target time.
|
||||
@private
|
||||
@param inst {object} The current settings for this instance.
|
||||
@param show {string[]} Flags indicating which periods are requested/required.
|
||||
@param significant {number} The number of periods with values to show, zero for all.
|
||||
@param now {Date} The current date and time.
|
||||
@return {number[]} The current time periods (always positive)
|
||||
by year, month, week, day, hour, minute, second. */
|
||||
_calculatePeriods: function(inst, show, significant, now) {
|
||||
// Find endpoints
|
||||
inst._now = now;
|
||||
inst._now.setMilliseconds(0);
|
||||
var until = new Date(inst._now.getTime());
|
||||
if (inst._since) {
|
||||
if (now.getTime() < inst._since.getTime()) {
|
||||
inst._now = now = until;
|
||||
}
|
||||
else {
|
||||
now = inst._since;
|
||||
}
|
||||
}
|
||||
else {
|
||||
until.setTime(inst._until.getTime());
|
||||
if (now.getTime() > inst._until.getTime()) {
|
||||
inst._now = now = until;
|
||||
}
|
||||
}
|
||||
// Calculate differences by period
|
||||
var periods = [0, 0, 0, 0, 0, 0, 0];
|
||||
if (show[Y] || show[O]) {
|
||||
// Treat end of months as the same
|
||||
var lastNow = this._getDaysInMonth(now.getFullYear(), now.getMonth());
|
||||
var lastUntil = this._getDaysInMonth(until.getFullYear(), until.getMonth());
|
||||
var sameDay = (until.getDate() == now.getDate() ||
|
||||
(until.getDate() >= Math.min(lastNow, lastUntil) &&
|
||||
now.getDate() >= Math.min(lastNow, lastUntil)));
|
||||
var getSecs = function(date) {
|
||||
return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
|
||||
};
|
||||
var months = Math.max(0,
|
||||
(until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
|
||||
((until.getDate() < now.getDate() && !sameDay) ||
|
||||
(sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
|
||||
periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
|
||||
periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
|
||||
// Adjust for months difference and end of month if necessary
|
||||
now = new Date(now.getTime());
|
||||
var wasLastDay = (now.getDate() == lastNow);
|
||||
var lastDay = this._getDaysInMonth(now.getFullYear() + periods[Y],
|
||||
now.getMonth() + periods[O]);
|
||||
if (now.getDate() > lastDay) {
|
||||
now.setDate(lastDay);
|
||||
}
|
||||
now.setFullYear(now.getFullYear() + periods[Y]);
|
||||
now.setMonth(now.getMonth() + periods[O]);
|
||||
if (wasLastDay) {
|
||||
now.setDate(lastDay);
|
||||
}
|
||||
}
|
||||
var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
|
||||
var extractPeriod = function(period, numSecs) {
|
||||
periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
|
||||
diff -= periods[period] * numSecs;
|
||||
};
|
||||
extractPeriod(W, 604800);
|
||||
extractPeriod(D, 86400);
|
||||
extractPeriod(H, 3600);
|
||||
extractPeriod(M, 60);
|
||||
extractPeriod(S, 1);
|
||||
if (diff > 0 && !inst._since) { // Round up if left overs
|
||||
var multiplier = [1, 12, 4.3482, 7, 24, 60, 60];
|
||||
var lastShown = S;
|
||||
var max = 1;
|
||||
for (var period = S; period >= Y; period--) {
|
||||
if (show[period]) {
|
||||
if (periods[lastShown] >= max) {
|
||||
periods[lastShown] = 0;
|
||||
diff = 1;
|
||||
}
|
||||
if (diff > 0) {
|
||||
periods[period]++;
|
||||
diff = 0;
|
||||
lastShown = period;
|
||||
max = 1;
|
||||
}
|
||||
}
|
||||
max *= multiplier[period];
|
||||
}
|
||||
}
|
||||
if (significant) { // Zero out insignificant periods
|
||||
for (var period = Y; period <= S; period++) {
|
||||
if (significant && periods[period]) {
|
||||
significant--;
|
||||
}
|
||||
else if (!significant) {
|
||||
periods[period] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return periods;
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,96 @@
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
|
||||
jQuery('.ult_colorlink').hover(function() {
|
||||
|
||||
var style = jQuery(this).data('style');
|
||||
|
||||
|
||||
if(style=='Style_6'){
|
||||
var shadowcolor = jQuery(this).find('.ult_btn6_link_top').data('color');
|
||||
jQuery( this ).find('.ult_btn6_link_top').css("text-shadow","10px 0 "+shadowcolor+", -10px 0 "+shadowcolor);
|
||||
jQuery( this ).find('.ult_btn6_link_top').css("color",shadowcolor);
|
||||
|
||||
}
|
||||
|
||||
if(style=='Style_10'){
|
||||
var bhover = jQuery(this).find('.ult_btn10_span').data('bhover');
|
||||
var bstyle = jQuery(this).find('.ult_btn10_span').data('bstyle');
|
||||
if(bstyle!=' '){
|
||||
jQuery( this ).find('.ult_btn10_span').css("border-top-style","solid");
|
||||
jQuery( this ).find('.ult_btn10_span').css("border-top-color",bhover);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var texthover = jQuery(this).data('texthover');
|
||||
var bghover= jQuery(this).data('bghover');
|
||||
|
||||
jQuery( this ).css("color",texthover);
|
||||
jQuery( this ).find('.ult_btn10_span').css("color",texthover);
|
||||
|
||||
|
||||
if(style=='Style_2'){
|
||||
jQuery( this ).find('.ult_btn10_span').css("background",bghover);
|
||||
}
|
||||
|
||||
},
|
||||
function() {
|
||||
|
||||
|
||||
var style = jQuery(this).data('style');
|
||||
|
||||
|
||||
if(style=='Style_6'){
|
||||
|
||||
jQuery( this ).find('.ult_btn6_link_top').removeAttr('style');
|
||||
|
||||
}
|
||||
if(style=='Style_10'){
|
||||
var bcolor = jQuery(this).find('.ult_btn10_span').data('color');
|
||||
var bstyle = jQuery(this).find('.ult_btn10_span').data('bstyle');
|
||||
if(bstyle!=' '){
|
||||
jQuery( this ).find('.ult_btn10_span').css("border-top-style",bstyle);
|
||||
jQuery( this ).find('.ult_btn10_span').css("border-top-color",bcolor);
|
||||
}
|
||||
}
|
||||
|
||||
var textcolor = jQuery(this).data('textcolor');
|
||||
var bgcolor= jQuery(this).data('bgcolor');
|
||||
|
||||
jQuery( this ).css("color",textcolor);
|
||||
jQuery( this ).find('.ult_btn10_span').css("color",textcolor);
|
||||
|
||||
if(style=='Style_2'){
|
||||
jQuery( this ).find('.ult_btn10_span').css("background",bgcolor);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
jQuery(window).load(function(){
|
||||
ult_creative_link_ht();
|
||||
});
|
||||
jQuery(document).ready(function($) {
|
||||
ult_creative_link_ht();
|
||||
});
|
||||
jQuery(window).resize(function(event) {
|
||||
ult_creative_link_ht();
|
||||
});
|
||||
|
||||
function ult_creative_link_ht(){
|
||||
jQuery( ".ult_cl_link_9" ).each(function( index ) {
|
||||
|
||||
var ht=jQuery(this).find('.ult_colorlink').outerHeight();
|
||||
//console.log("alink-"+jQuery(this).parents('.ult_main_cl').outerHeight());
|
||||
var ht=parseInt(ht/2);
|
||||
//console.log(ht);
|
||||
jQuery(this).find('.ult_btn9_link_top').css({"-webkit-transform":"translateY(-"+ht+"px)","-ms-transform":"translateY(-"+ht+"px)","-moz-transform":"translateY(-"+ht+"px)","transform":"translateY(-"+ht+"px)"});
|
||||
jQuery(this).find('.ult_btn9_link_btm').css({"-webkit-transform":"translateY("+ht+"px)","-moz-transform":"translateY("+ht+"px)","-ms-transform":"translateY("+ht+"px)","transform":"translateY("+ht+"px)"});
|
||||
|
||||
});
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,476 @@
|
||||
(function(jQuery) {
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
var width=jQuery( window ).width();
|
||||
if(width>300 && width <768)
|
||||
{
|
||||
var bshadow="inset 0px -200px 0px 0px ";
|
||||
var bshadow2=" inset 0px 200px 0px 0px ";
|
||||
}
|
||||
else if( width>768 && width<1015){
|
||||
var bshadow="inset 0px -200px 0px 0px ";
|
||||
var bshadow2=" inset 0px 200px 0px 0px ";
|
||||
}
|
||||
else{
|
||||
var bshadow="inset -200px 0 0 0 ";
|
||||
var bshadow2="inset 200px 0 0 0";
|
||||
}
|
||||
|
||||
/*--- bt1 ----*/
|
||||
jQuery(document).on("mouseenter", ".ult_dual1", function() {
|
||||
|
||||
var style=jQuery(this).find('.ult-dual-btn-1').attr('class');
|
||||
var arr=style.split(" ");
|
||||
var style=arr[1]+arr[2];
|
||||
|
||||
if(style=='Style1')
|
||||
{
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-1').data('bghovercolor');
|
||||
jQuery(this)[0].style.setProperty( 'background-color', bghover, 'important' );
|
||||
}
|
||||
if(style=='Style2')
|
||||
{
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-1').data('bghovercolor');
|
||||
}
|
||||
|
||||
if(style=='Style3')
|
||||
{
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-1').data('bghovercolor');
|
||||
jQuery(this).css({'box-shadow':' inset 0 0 20px 50px '+bghover})
|
||||
}
|
||||
|
||||
if(style!='undefined')
|
||||
{
|
||||
var iconhover = jQuery(this).find('.ult-dual-btn-1').data('icon_hover_color');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon').css({'color':iconhover});
|
||||
|
||||
var iconbghover = jQuery(this).find('.ult-dual-btn-1').data('iconbghovercolor');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon').css({'background':iconbghover});
|
||||
|
||||
var iconborderhover = jQuery(this).find('.ult-dual-btn-1').data('iconhoverborder');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon').css({'border-color':iconborderhover});
|
||||
|
||||
//for image hover
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon-img').css({'background':iconbghover});
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon-img').css({'border-color':iconborderhover});
|
||||
|
||||
var titlehover = jQuery(this).find('.ult-dual-btn-1').data('texthovercolor');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.ult-dual-button-title').css({'color':titlehover});
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(document).on("mouseleave", ".ult_dual1", function() {
|
||||
|
||||
var style1=jQuery(this).find('.ult-dual-btn-1').attr('class');
|
||||
var arr=style1.split(" ");
|
||||
var style1=arr[1]+arr[2];
|
||||
|
||||
if(style1=='Style1'){
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-1').data('bgcolor');
|
||||
jQuery(this)[0].style.setProperty( 'background-color', bgcolor, 'important' );
|
||||
}
|
||||
|
||||
if(style1=='Style2')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-1').data('bgcolor');
|
||||
}
|
||||
if(style1=='Style3')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-1').data('bgcolor');
|
||||
jQuery(this).css({'box-shadow':'inset 0px 0 0 0 '+bgcolor});
|
||||
}
|
||||
if(style1!='undefined')
|
||||
{
|
||||
var iconcolor = jQuery(this).find('.ult-dual-btn-1').data('icon_color');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon').css({'color':iconcolor});
|
||||
|
||||
var titlecolor = jQuery(this).find('.ult-dual-btn-1').data('textcolor');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.ult-dual-button-title').css({'color':titlecolor});
|
||||
|
||||
var iconbgcolor = jQuery(this).find('.ult-dual-btn-1').data('iconbgcolor');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon').css({'background':iconbgcolor});
|
||||
|
||||
var iconbordercolor = jQuery(this).find('.ult-dual-btn-1').data('iconborder');
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon').css({'border-color':iconbordercolor});
|
||||
|
||||
//for image hover
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon-img').css({'background':iconbgcolor});
|
||||
jQuery(this).find('.ult-dual-btn-1').find('.aio-icon-img').css({'border-color':iconbordercolor});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
/*--- bt2 ----*/
|
||||
jQuery(document).on("mouseenter", ".ult_dual2", function() {
|
||||
|
||||
var style1=jQuery(this).find('.ult-dual-btn-2').attr('class');
|
||||
var arr=style1.split(" ");
|
||||
var style1=arr[1]+arr[2];
|
||||
|
||||
if(style1=='Style1'){
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-2').data('bghovercolor');
|
||||
jQuery(this)[0].style.setProperty( 'background-color', bghover, 'important' );
|
||||
|
||||
}
|
||||
|
||||
if(style1=='Style2')
|
||||
{
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-2').data('bghovercolor');
|
||||
}
|
||||
if(style1=='Style3')
|
||||
{
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-2').data('bghovercolor');
|
||||
jQuery(this).css({'box-shadow':' inset 0 0 20px 50px '+bghover});
|
||||
}
|
||||
|
||||
if(style1!='undefined')
|
||||
{
|
||||
var iconhover = jQuery(this).find('.ult-dual-btn-2').data('icon_hover_color');
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon').css({'color':iconhover});
|
||||
|
||||
var titlehover = jQuery(this).find('.ult-dual-btn-2').data('texthovercolor');
|
||||
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.ult-dual-button-title').css({'color':titlehover});
|
||||
|
||||
var iconbghover = jQuery(this).find('.ult-dual-btn-2').data('iconbghovercolor');
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon').css({'background':iconbghover});
|
||||
|
||||
var iconborderhover = jQuery(this).find('.ult-dual-btn-2').data('iconhoverborder');
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon').css({'border-color':iconborderhover});
|
||||
|
||||
//for image hover
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon-img').css({'background':iconbghover});
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon-img').css({'border-color':iconborderhover});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(document).on("mouseleave", ".ult_dual2", function() {
|
||||
var style1=jQuery(this).find('.ult-dual-btn-2').attr('class');
|
||||
var arr=style1.split(" ");
|
||||
var style1=arr[1]+arr[2];
|
||||
if(style1=='Style1'){
|
||||
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-2').data('bgcolor');
|
||||
jQuery(this)[0].style.setProperty( 'background-color', bgcolor, 'important' );
|
||||
}
|
||||
|
||||
if(style1=='Style2')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-2').data('bgcolor');
|
||||
|
||||
}
|
||||
|
||||
if(style1=='Style3')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-2').data('bghovercolor');
|
||||
jQuery(this).css({'box-shadow':' inset 0 0 0 0 '+bgcolor});
|
||||
}
|
||||
|
||||
if(style1!='undefined')
|
||||
{
|
||||
var iconcolor = jQuery(this).find('.ult-dual-btn-2').data('icon_color');
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon').css({'color':iconcolor});
|
||||
|
||||
var titlecolor = jQuery(this).find('.ult-dual-btn-2').data('textcolor');
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.ult-dual-button-title').css({'color':titlecolor});
|
||||
|
||||
var iconbgcolor = jQuery(this).find('.ult-dual-btn-2').data('iconbgcolor');
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon').css({'background':iconbgcolor});
|
||||
|
||||
var iconbordercolor = jQuery(this).find('.ult-dual-btn-2').data('iconborder');
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon').css({'border-color':iconbordercolor});
|
||||
|
||||
//for image hover
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon-img').css({'background':iconbgcolor});
|
||||
jQuery(this).find('.ult-dual-btn-2').find('.aio-icon-img').css({'border-color':iconbordercolor});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
/*---for button----*/
|
||||
|
||||
jQuery(document).on("mouseenter", ".ult_main_dualbtn", function() {
|
||||
var mainhoverborder = jQuery(this).data('bhcolor');
|
||||
});
|
||||
|
||||
jQuery(document).on("mouseleave", ".ult_main_dualbtn", function() {
|
||||
var mainborder = jQuery(this).data('bcolor');
|
||||
});
|
||||
|
||||
}( jQuery ));
|
||||
|
||||
jQuery(document).ready(function(e){
|
||||
jQuery( ".ult_main_dualbtn" ).each(function( index ) {
|
||||
|
||||
var ht1=jQuery(this).find('.ult_dual1').outerHeight();
|
||||
ht1=parseInt(ht1);
|
||||
|
||||
var ht2=jQuery(this).find('.ult_dual2').outerHeight();
|
||||
ht2=parseInt(ht2);
|
||||
|
||||
if(ht1>ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht1});
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht1});
|
||||
|
||||
}
|
||||
else if(ht1<ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht2});
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht2});
|
||||
|
||||
}
|
||||
else if(ht1==ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht2});
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht2});
|
||||
|
||||
}
|
||||
});
|
||||
jQuery( document ).on( "ult-expandable", function( e, selector ) {
|
||||
jQuery(selector).find(".ult_dual_button" ).each(function ( index ) {
|
||||
|
||||
jQuery(this).find('.ult_dual1').css('height', 'auto');
|
||||
jQuery(this).find('.ult_dual2').css('height', 'auto');
|
||||
|
||||
var ht1=jQuery(this).find('.ult_dual1').outerHeight();
|
||||
ht1=parseInt(ht1);
|
||||
|
||||
var ht2=jQuery(this).find('.ult_dual2').outerHeight();
|
||||
ht2=parseInt(ht2);
|
||||
|
||||
if(ht1>ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht1});
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht1});
|
||||
|
||||
}
|
||||
else if(ht1<ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht2});
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht2});
|
||||
|
||||
}
|
||||
else if(ht1==ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht2});
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht2});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
jQuery( document ).on( "ultAdvancedTabClickedDualBtn", function( e, selector ) {
|
||||
jQuery(selector).find(".ult_dual_button" ).each(function ( index ) {
|
||||
|
||||
jQuery(this).find('.ult_dual1').css('height', 'auto');
|
||||
jQuery(this).find('.ult_dual2').css('height', 'auto');
|
||||
|
||||
var ht1=jQuery(this).find('.ult_dual1').outerHeight();
|
||||
ht1=parseInt(ht1);
|
||||
|
||||
var ht2=jQuery(this).find('.ult_dual2').outerHeight();
|
||||
ht2=parseInt(ht2);
|
||||
|
||||
if(ht1>ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht1});
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht1});
|
||||
|
||||
}
|
||||
else if(ht1<ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht2});
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht2});
|
||||
|
||||
}
|
||||
else if(ht1==ht2)
|
||||
{
|
||||
jQuery(this).find('.ult_dual1').css({'height':ht2});
|
||||
jQuery(this).find('.ult_dual2').css({'height':ht2});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function recallme(){
|
||||
jQuery( ".ult_dual_button" ).each(function( index ) {
|
||||
var id=jQuery(this).attr("id");
|
||||
var response=jQuery(this).data("response");
|
||||
if(response=='undefined' || response==''){
|
||||
response='on';
|
||||
}
|
||||
|
||||
var rtl_right = 'right';
|
||||
if ( jQuery( 'body' ).hasClass('rtl') ) {
|
||||
var rtl_right = 'left';
|
||||
}
|
||||
|
||||
var rtl_left = 'left';
|
||||
if ( jQuery( 'body' ).hasClass('rtl') ) {
|
||||
var rtl_left = 'right';
|
||||
}
|
||||
|
||||
if(response=="on")
|
||||
{
|
||||
var style =id;
|
||||
style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = "@media(min-width:300px) and (max-width:768px) {"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper { margin: 0px;float: none;position: relative}.ult_main_dualbtn { display: inline-block}.ult_dualbutton-wrapper { display: block }"+"#"+id+".ult_dual_button .middle-text {top: 100%;right: 50%}"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:first-child .ult_ivan_button { border-bottom-right-radius: 0!important; border-bottom-left-radius: 0!important; border-top-right-radius: inherit; border-bottom: 0px!important;}"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:last-child .ult_ivan_button { border-top-left-radius: 0!important;border-top-right-radius: 0!important}}@media(min-width:0px) and (max-width:0px) {"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper { float: left; position: relative}.ult_dual1 { border-right: none!important } .ult_dualbutton-wrapper {display: block}"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:first-child .ult_ivan_button { border-top-right-radius: 0!important; border-bottom-right-radius: 0!important}"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:last-child .ult_ivan_button { border-top-left-radius: 0!important; border-bottom-left-radius: 0!important }}@media(min-width:768px) and (max-width:970px) { "+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper { margin: -4px; float: none; position: relative }.ult_dualbutton-wrapper { display: block} "+"#"+id+".ult_dual_button .middle-text { top: 100%; right: 50% }"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:first-child .ult_ivan_button { border-bottom-right-radius: 0!important; border-bottom-left-radius: 0!important; border-top-right-radius: inherit }"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:last-child .ult_ivan_button { border-top-left-radius: 0!important; border-top-right-radius: 0!important }}@media(min-width:970px){ "+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:first-child .ult_ivan_button { border-top-"+ rtl_right +"-radius: 0!important; border-bottom-"+ rtl_right +"-radius: 0!important}"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:last-child .ult_ivan_button { border-top-"+ rtl_left +"-radius: 0!important; border-bottom-"+ rtl_left +"-radius: 0!important }"+"#"+id+".ult_dual_button .ult_dual1 { border-"+ rtl_right +": none!important}}";
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
|
||||
var width=jQuery( window ).width();
|
||||
var b1w = jQuery(this).find('.ult_dual1').outerWidth();
|
||||
var b2w = jQuery(this).find('.ult_dual2').outerWidth();
|
||||
if(width>300 && width <=768)
|
||||
{
|
||||
var bshadow="inset 0px -"+b1w+"px 0px 0px ";
|
||||
var bshadow2=" inset 0px "+b2w+"px 0px 0px ";
|
||||
}
|
||||
else if( width>768 && width<1015){
|
||||
var bshadow="inset 0px -"+b1w+"px 0px 0px ";
|
||||
var bshadow2=" inset 0px "+b2w+"px 0px 0px ";
|
||||
}
|
||||
else{
|
||||
var bshadow="inset -"+b1w+"px 0 0 0 ";
|
||||
var bshadow2="inset "+b2w+"px 0 0 0";
|
||||
}
|
||||
|
||||
//change box shaddow of button1
|
||||
jQuery("#"+id).find(".ult_dual1").mouseenter(function(){
|
||||
|
||||
var style=jQuery(this).find('.ult-dual-btn-1').attr('class');
|
||||
var arr=style.split(" ");
|
||||
var style=arr[1]+arr[2];
|
||||
|
||||
if(style=='Style2')
|
||||
{
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-1').data('bghovercolor');
|
||||
jQuery(this).css({'box-shadow':bshadow+bghover})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery("#"+id).find(".ult_dual1").mouseleave(function(){
|
||||
var style=jQuery(this).find('.ult-dual-btn-1').attr('class');
|
||||
var arr=style.split(" ");
|
||||
var style=arr[1]+arr[2];
|
||||
|
||||
if(style=='Style2')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-1').data('bgcolor');
|
||||
jQuery(this).css({'box-shadow':'inset 0px 0 0 0 '+bgcolor});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//change box shaddow of button2
|
||||
|
||||
jQuery("#"+id).find(".ult_dual2").mouseenter(function(){
|
||||
var style1=jQuery(this).find('.ult-dual-btn-2').attr('class');
|
||||
var arr=style1.split(" ");
|
||||
var style1=arr[1]+arr[2];
|
||||
if(style1=='Style2')
|
||||
{
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-2').data('bghovercolor');
|
||||
jQuery(this).css({'box-shadow':bshadow2+' '+bghover});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery("#"+id).find(".ult_dual2").mouseleave(function(){
|
||||
var style1=jQuery(this).find('.ult-dual-btn-2').attr('class');
|
||||
var arr=style1.split(" ");
|
||||
var style1=arr[1]+arr[2];
|
||||
|
||||
if(style1=='Style2')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-2').data('bgcolor');
|
||||
jQuery(this).css({'box-shadow':'inset 0px 0 0 0 '+bgcolor});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
var style =id;
|
||||
style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = "#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:first-child .ult_ivan_button { border-top-right-radius: 0!important; border-bottom-right-radius: 0!important }"+"#"+id+".ult_dual_button .ulitmate_dual_buttons .ult_dualbutton-wrapper:last-child .ult_ivan_button { border-top-left-radius: 0!important; border-bottom-left-radius: 0!important }"+"#"+id+".ult_dual_button .ult_dual1 { border-right: none!important}";
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
|
||||
//change box shaddow of button1
|
||||
|
||||
jQuery("#"+id).find(".ult_dual1").mouseenter(function(){
|
||||
|
||||
var style=jQuery(this).find('.ult-dual-btn-1').attr('class');
|
||||
var arr=style.split(" ");
|
||||
var style=arr[1]+arr[2];
|
||||
|
||||
var wd = jQuery(this).outerWidth();
|
||||
|
||||
if(style=='Style2')
|
||||
{
|
||||
var bshadow="inset -"+wd+"px 0 0 0 ";
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-1').data('bghovercolor');
|
||||
jQuery(this).css({'box-shadow':bshadow+bghover})
|
||||
}
|
||||
|
||||
});
|
||||
jQuery("#"+id).find(".ult_dual1").mouseleave(function(){
|
||||
var style=jQuery(this).find('.ult-dual-btn-1').attr('class');
|
||||
var arr=style.split(" ");
|
||||
var style=arr[1]+arr[2];
|
||||
|
||||
if(style=='Style2')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-1').data('bgcolor');
|
||||
jQuery(this).css({'box-shadow':'inset 0px 0 0 0 '+bgcolor});
|
||||
|
||||
}
|
||||
});
|
||||
//change box shaddow of button2
|
||||
|
||||
jQuery("#"+id).find(".ult_dual2").mouseenter(function(){
|
||||
var style1=jQuery(this).find('.ult-dual-btn-2').attr('class');
|
||||
var arr=style1.split(" ");
|
||||
var style1=arr[1]+arr[2];
|
||||
var wd = jQuery(this).outerWidth();
|
||||
if(style1=='Style2')
|
||||
{
|
||||
var bshadow2="inset "+wd+"px 0 0 0";
|
||||
var bghover = jQuery(this).find('.ult-dual-btn-2').data('bghovercolor');
|
||||
jQuery(this).css({'box-shadow':bshadow2+bghover});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery("#"+id).find(".ult_dual2").mouseleave(function(){
|
||||
var style1=jQuery(this).find('.ult-dual-btn-2').attr('class');
|
||||
var arr=style1.split(" ");
|
||||
var style1=arr[1]+arr[2];
|
||||
|
||||
if(style1=='Style2')
|
||||
{
|
||||
var bgcolor = jQuery(this).find('.ult-dual-btn-2').data('bgcolor');
|
||||
jQuery(this).css({'box-shadow':'inset 0px 0 0 0 '+bgcolor});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//responsive media query for button
|
||||
jQuery(document).ready(function(p){
|
||||
recallme();
|
||||
jQuery( window ).load(function() {
|
||||
recallme();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
* jQuery - Easy Ticker plugin - v2.0
|
||||
* http://www.aakashweb.com/
|
||||
* Copyright 2014, Aakash Chakravarthy
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
;(function ( $, window, document, undefined ) {
|
||||
|
||||
var name = "easyTicker",
|
||||
defaults = {
|
||||
direction: 'up',
|
||||
easing: 'swing',
|
||||
speed: 'slow',
|
||||
interval: 2000,
|
||||
height: 'auto',
|
||||
visible: 0,
|
||||
mousePause: 1,
|
||||
controls: {
|
||||
up: '',
|
||||
down: '',
|
||||
toggle: '',
|
||||
playText: 'Play',
|
||||
stopText: 'Stop'
|
||||
}
|
||||
};
|
||||
|
||||
// Constructor
|
||||
function EasyTicker( el, options ) {
|
||||
|
||||
var s = this;
|
||||
|
||||
s.opts = $.extend( {}, defaults, options );
|
||||
s.elem = $(el);
|
||||
s.targ = $(el).children(':first-child');
|
||||
s.timer = 0;
|
||||
s.mHover = 0;
|
||||
s.winFocus = 1;
|
||||
|
||||
init();
|
||||
start();
|
||||
|
||||
$([window, document]).off('focus.jqet').on('focus.jqet', function(){
|
||||
s.winFocus = 1;
|
||||
}).off('blur.jqet').on('blur.jqet', function(){
|
||||
s.winFocus = 0;
|
||||
});
|
||||
|
||||
if( s.opts.mousePause == 1 ){
|
||||
s.elem.mouseenter(function(){
|
||||
s.timerTemp = s.timer;
|
||||
stop();
|
||||
}).mouseleave(function(){
|
||||
if( s.timerTemp !== 0 )
|
||||
start();
|
||||
});
|
||||
}
|
||||
|
||||
$(s.opts.controls.up).on('click', function(e){
|
||||
e.preventDefault();
|
||||
moveDir('up');
|
||||
});
|
||||
|
||||
$(s.opts.controls.down).on('click', function(e){
|
||||
e.preventDefault();
|
||||
moveDir('down');
|
||||
});
|
||||
|
||||
$(s.opts.controls.toggle).on('click', function(e){
|
||||
e.preventDefault();
|
||||
if( s.timer == 0 ) start();
|
||||
else stop();
|
||||
});
|
||||
|
||||
function init(){
|
||||
|
||||
s.elem.children().css('margin', 0).children().css('margin', 0);
|
||||
|
||||
s.elem.css({
|
||||
position : 'relative',
|
||||
height: s.opts.height,
|
||||
overflow : 'hidden'
|
||||
});
|
||||
|
||||
s.targ.css({
|
||||
'position' : 'absolute',
|
||||
'margin' : 0
|
||||
});
|
||||
|
||||
setInterval( function(){
|
||||
adjHeight();
|
||||
}, 100);
|
||||
|
||||
} // Init Method
|
||||
|
||||
function start(){
|
||||
s.timer = setInterval(function(){
|
||||
if( s.winFocus == 1 ){
|
||||
move( s.opts.direction );
|
||||
}
|
||||
}, s.opts.interval);
|
||||
|
||||
$(s.opts.controls.toggle).addClass('et-run').html(s.opts.controls.stopText);
|
||||
|
||||
} // Start method
|
||||
|
||||
|
||||
function stop(){
|
||||
clearInterval( s.timer );
|
||||
s.timer = 0;
|
||||
$(s.opts.controls.toggle).removeClass('et-run').html(s.opts.controls.playText);
|
||||
}// Stop
|
||||
|
||||
|
||||
function move( dir ){
|
||||
var sel, eq, appType;
|
||||
|
||||
if( !s.elem.is(':visible') ) return;
|
||||
|
||||
if( dir == 'up' ){
|
||||
sel = ':first-child';
|
||||
eq = '-=';
|
||||
appType = 'appendTo';
|
||||
}else{
|
||||
sel = ':last-child';
|
||||
eq = '+=';
|
||||
appType = 'prependTo';
|
||||
}
|
||||
|
||||
var selChild = s.targ.children(sel);
|
||||
var height = selChild.outerHeight();
|
||||
|
||||
s.targ.stop(true, true).animate({
|
||||
'top': eq + height + "px"
|
||||
}, s.opts.speed, s.opts.easing, function(){
|
||||
|
||||
selChild.hide()[appType]( s.targ ).fadeIn();
|
||||
s.targ.css('top', 0);
|
||||
|
||||
adjHeight();
|
||||
|
||||
});
|
||||
}// Move
|
||||
|
||||
function moveDir( dir ){
|
||||
stop();
|
||||
if( dir == 'up' ) move('up'); else move('down');
|
||||
// start();
|
||||
}
|
||||
|
||||
function fullHeight(){
|
||||
var height = 0;
|
||||
var tempDisp = s.elem.css('display'); // Get the current el display value
|
||||
|
||||
s.elem.css('display', 'block');
|
||||
|
||||
s.targ.children().each(function(){
|
||||
height += $(this).outerHeight();
|
||||
});
|
||||
|
||||
s.elem.css({
|
||||
'display' : tempDisp,
|
||||
'height' : height
|
||||
});
|
||||
}
|
||||
|
||||
function visHeight( anim ){
|
||||
var wrapHeight = 0;
|
||||
s.targ.children(':lt(' + s.opts.visible + ')').each(function(){
|
||||
wrapHeight += $(this).outerHeight();
|
||||
});
|
||||
|
||||
if( anim == 1 ){
|
||||
s.elem.stop(true, true).animate({height: wrapHeight}, s.opts.speed);
|
||||
}else{
|
||||
s.elem.css( 'height', wrapHeight);
|
||||
}
|
||||
}
|
||||
|
||||
function adjHeight(){
|
||||
if( s.opts.height == 'auto' && s.opts.visible != 0 ){
|
||||
anim = arguments.callee.caller.name == 'init' ? 0 : 1;
|
||||
visHeight( anim );
|
||||
}else if( s.opts.height == 'auto' ){
|
||||
fullHeight();
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
up: function(){ moveDir('up'); },
|
||||
down: function(){ moveDir('down'); },
|
||||
start: start,
|
||||
stop: stop,
|
||||
options: s.opts
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// Attach the object to the DOM
|
||||
$.fn[name] = function ( options ) {
|
||||
return this.each(function () {
|
||||
if (!$.data(this, name)) {
|
||||
$.data(this, name, new EasyTicker( this, options ));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
})( jQuery, window, document );
|
||||
@@ -0,0 +1,245 @@
|
||||
/*jQuery(document).ready(function(){jQuery(".ult_exp_content").hide(),jQuery(".ult_exp_section").click(function(){var e=jQuery(this).data("effect");if(jQuery(this).toggleClass("ult_active_section"),jQuery(this).next(".ult_exp_content").toggleClass("ult_active_section"),"slideToggle"==e&&jQuery(this).next(".ult_exp_content").slideToggle(500),"fadeToggle"==e){var t=jQuery(this).next(".ult_exp_content");t.is(":visible")?t.fadeTo(500,0,function(){t.slideUp()}):t.slideDown(function(){t.fadeTo(500,1)})}jQuery(this).trigger("select")}),jQuery(".ult_exp_section").select(function(){var e=jQuery(this).data("title"),t=jQuery(this).data("newtitle"),i=jQuery(this).data("icon"),r=jQuery(this).data("newicon"),s=jQuery(this).data("img"),n=jQuery(this).data("newimg"),u=jQuery(this).data("activetitle"),a=jQuery(this).data("activebg"),c=jQuery(this).data("activeicon"),o=jQuery(this).data("activeiconbg"),l=jQuery(this).data("activeborder");jQuery(this).css({color:u}),jQuery(this).parent().find(".ult_exp_section").css({background:a}),jQuery(this).find(".ult_expsection_icon").css({color:c}),jQuery(this).find(".ult_expsection_icon").css({background:o}),jQuery(this).find(".ult_expsection_icon").css({"border-color":l}),jQuery(this).find(".ult_expheader").stop().css("opacity","0.1").html(function(i,r){return r==t?e:t}).animate({opacity:1},300),jQuery(this).hasClass("ult_active_section")?(jQuery(this).find(".ult_ex_icon").removeClass(i),jQuery(this).find(".ult_ex_icon").fadeOut(100).switchClass(i,r,1500,"easeInOutQuad").fadeIn(300),jQuery(this).find(".ult_exp_img").fadeOut(200).attr("src",n).fadeIn(500)):(jQuery(this).find(".ult_ex_icon").removeClass(r),jQuery(this).find(".ult_ex_icon").fadeOut(100).switchClass(r,i,1500,"easeInOutQuad").fadeIn(300),jQuery(this).find(".ult_exp_img").fadeOut(200).attr("src",s).fadeIn(500))})}),jQuery(document).ready(function(){function e(){jQuery(".ult_exp_section_layer").each(function(e,t){jQuery(t).css({"margin-left":0});var i=jQuery(t).find(".ult_exp_section").data("override");if(0!=i){var r="true";if(jQuery(t).parents(".wpb_row").length>0)var s=jQuery(t).parents(".wpb_column");else if(jQuery(t).parents(".wpb_column").length>0)var s=jQuery(t).parents(".wpb_row");else var s=jQuery(t).parent();if("full"==i&&(s=jQuery("body"),r="false"),"ex-full"==i&&(s=jQuery("html"),r="false"),!isNaN(i))for(var e=1;i>e&&"HTML"!=s.prop("tagName");e++)s=s.parent();if("false"==r)var n=s.outerWidth();else var n=s.width();var u=s.offset().left,a=jQuery(t).offset().left,c=u-a;jQuery(t).css("false"==r?{width:n,"margin-left":c}:{width:n})}})}jQuery(".ult_exp_section").hover(function(){var e=jQuery(this).data("texthover"),t=jQuery(this).data("ihover"),i=(jQuery(this).data("cnthvrbg"),jQuery(this).data("headerhover")),r=jQuery(this).data("icnhvrbg"),s=jQuery(this).data("icnhvrborder");jQuery(this).hasClass("ult_active_section")||(jQuery(this).css({color:e,background:i}),jQuery(this).find(".ult_expsection_icon").css({color:t}),jQuery(this).find(".ult_expsection_icon").css({background:r}),jQuery(this).find(".ult_expsection_icon").css({"border-color":s}))},function(){var e=jQuery(this).data("textcolor"),t=jQuery(this).data("icncolor"),i=(jQuery(this).data("cntbg"),jQuery(this).data("headerbg")),r=jQuery(this).data("icnbg"),s=jQuery(this).data("icnborder");jQuery(this).hasClass("ult_active_section")||(jQuery(this).css({color:e,background:i}),jQuery(this).find(".ult_expsection_icon").css({color:t}),jQuery(this).find(".ult_expsection_icon").css({background:r}),jQuery(this).find(".ult_expsection_icon").css({"border-color":s}))}),jQuery(".ult_exp_content").hover(function(){jQuery(this).parent().find(".ult_exp_section").data("cnthvrbg")},function(){jQuery(this).parent().find(".ult_exp_section").data("cntbg")}),jQuery(window).resize(function(){e()}),e()});*/
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(".ult_exp_content").hide();
|
||||
//toggle the componenet with class msg_body
|
||||
jQuery(".ult_exp_section").click(function()
|
||||
{
|
||||
var effect = jQuery(this).data('effect');
|
||||
|
||||
|
||||
jQuery(this).toggleClass("ult_active_section");
|
||||
|
||||
jQuery(this).next(".ult_exp_content").toggleClass("ult_active_section");
|
||||
if(effect=='slideToggle'){
|
||||
jQuery(this).next(".ult_exp_content").slideToggle(500);
|
||||
}
|
||||
if(effect=='fadeToggle'){
|
||||
//jQuery(this).next(".ult_exp_content").fadeToggle(500);
|
||||
var child= jQuery(this).next(".ult_exp_content");
|
||||
if(child.is(":visible")) {
|
||||
child.fadeTo(500, 0.0, function() {
|
||||
child.slideUp();
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
child.slideDown(function() {
|
||||
child.fadeTo(500, 1.0);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
/* bind trigger on click event*/
|
||||
jQuery(this).trigger("select");
|
||||
/* trigger on click event*/
|
||||
jQuery( document ).trigger( "ult-expandable", jQuery(this).next(".ult_exp_content") );
|
||||
|
||||
});
|
||||
|
||||
jQuery(".ult_exp_section").select(function(){
|
||||
|
||||
var title=jQuery(this).data('title');
|
||||
var title1=jQuery(this).data('newtitle');
|
||||
var icn=jQuery(this).data('icon');
|
||||
var icn1=jQuery(this).data('newicon');
|
||||
var img=jQuery(this).data('img');
|
||||
var img1=jQuery(this).data('newimg');
|
||||
|
||||
var activetitle=jQuery(this).data('activetitle');
|
||||
var activebg=jQuery(this).data('activebg');
|
||||
var acticon = jQuery(this).data('activeicon');
|
||||
var actiocnbg = jQuery(this).data('activeiconbg');
|
||||
var activeborder = jQuery(this).data('activeborder');
|
||||
|
||||
|
||||
jQuery(this).css({"color":activetitle});
|
||||
jQuery(this).parent().find('.ult_exp_section').css({"background":activebg});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"color":acticon});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"background":actiocnbg});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"border-color":activeborder});
|
||||
if(title!=title1){
|
||||
jQuery(this).find('.ult_expheader').stop().css('opacity', '0.1').html(function (_, oldText) {
|
||||
return oldText == title1 ? title : title1;
|
||||
|
||||
|
||||
}).animate({
|
||||
opacity: 1
|
||||
}, 300);
|
||||
}
|
||||
/*----icon replace---------*/
|
||||
if(jQuery(this).hasClass("ult_active_section")){
|
||||
|
||||
if(icn!==icn1){
|
||||
jQuery(this).find('.ult_ex_icon').removeClass(icn);
|
||||
jQuery(this).find('.ult_ex_icon').fadeOut(100).switchClass( icn, icn1, 1500, "easeInOutQuad" ).fadeIn(300);
|
||||
}
|
||||
|
||||
if(img!==img1){
|
||||
jQuery(this).find('.ult_exp_img').fadeOut(200).attr('src', img1).fadeIn(500);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
if(icn!==icn1){
|
||||
jQuery(this).find('.ult_ex_icon').removeClass(icn1);
|
||||
jQuery(this).find('.ult_ex_icon').fadeOut(100).switchClass( icn1, icn, 1500, "easeInOutQuad" ).fadeIn(300);
|
||||
|
||||
}
|
||||
|
||||
if(img!==img1){
|
||||
jQuery(this).find('.ult_exp_img').fadeOut(200).attr('src', img).fadeIn(500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
|
||||
jQuery('.ult_exp_section').hover(function() {
|
||||
var texthover = jQuery(this).data('texthover');
|
||||
var ihover = jQuery(this).data('ihover');
|
||||
var cnthvrbg = jQuery(this).data('cnthvrbg');
|
||||
var headerhover = jQuery(this).data('headerhover');
|
||||
var icnhvrbg = jQuery(this).data('icnhvrbg');
|
||||
var icnhvrborder = jQuery(this).data('icnhvrborder');
|
||||
if(jQuery(this).hasClass("ult_active_section")){
|
||||
|
||||
}else{
|
||||
jQuery( this ).css({"color":texthover,"background":headerhover});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"color":ihover});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"background":icnhvrbg});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"border-color":icnhvrborder});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
function() {
|
||||
var textcolor = jQuery(this).data('textcolor');
|
||||
var icncolor = jQuery(this).data('icncolor');
|
||||
var cntbg = jQuery(this).data('cntbg');
|
||||
var headerbg = jQuery(this).data('headerbg');
|
||||
var icnbg = jQuery(this).data('icnbg');
|
||||
var icnborder = jQuery(this).data('icnborder');
|
||||
|
||||
if(jQuery(this).hasClass("ult_active_section")){
|
||||
|
||||
}else{
|
||||
jQuery( this ).css({"color":textcolor,"background":headerbg});
|
||||
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"color":icncolor});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"background":icnbg});
|
||||
jQuery( this ).find('.ult_expsection_icon').css({"border-color":icnborder});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
jQuery('.ult_exp_content').hover(function() {
|
||||
var bg = jQuery(this).parent().find('.ult_exp_section').data('cnthvrbg');
|
||||
|
||||
|
||||
},
|
||||
function() {
|
||||
|
||||
var bg1 = jQuery(this).parent().find('.ult_exp_section').data('cntbg');
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
function resize_ult_section()
|
||||
{
|
||||
|
||||
jQuery('.ult_exp_section_layer').each(function(i,element){
|
||||
|
||||
|
||||
jQuery(element).css({'margin-left' : 0 });
|
||||
var override = jQuery(element).find('.ult_exp_section').data('override');
|
||||
|
||||
if(override != 0)
|
||||
{
|
||||
var is_relative = 'true';
|
||||
if(jQuery(element).parents('.wpb_row').length > 0)
|
||||
var ancenstor = jQuery(element).parents('.wpb_column');
|
||||
else if(jQuery(element).parents('.wpb_column').length > 0)
|
||||
var ancenstor = jQuery(element).parents('.wpb_row');
|
||||
else
|
||||
var ancenstor = jQuery(element).parent();
|
||||
|
||||
var parent = ancenstor;
|
||||
if(override=='full'){
|
||||
ancenstor= jQuery('body');
|
||||
is_relative = 'false';
|
||||
}
|
||||
if(override=='ex-full'){
|
||||
ancenstor= jQuery('html');
|
||||
is_relative = 'false';
|
||||
}
|
||||
if( ! isNaN(override)){
|
||||
|
||||
for(var i=1;i<override;i++){
|
||||
if(ancenstor.prop('tagName')!='HTML'){
|
||||
ancenstor = ancenstor.parent();
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(is_relative == 'false'){
|
||||
|
||||
var w = ancenstor.outerWidth();
|
||||
}
|
||||
else{
|
||||
|
||||
var w = ancenstor.width();
|
||||
}
|
||||
|
||||
var a_left = ancenstor.offset().left;
|
||||
var left = jQuery(element).offset().left;
|
||||
var calculate_left = a_left - left;
|
||||
|
||||
|
||||
|
||||
if(is_relative =='false'){
|
||||
|
||||
jQuery(element).css({'width':w, 'margin-left' : calculate_left });
|
||||
}
|
||||
else {
|
||||
|
||||
jQuery(element).css({'width':w });
|
||||
}
|
||||
//jQuery(element).css({'width':w, 'margin-left' : calculate_left });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery( window ).resize(function() {
|
||||
|
||||
resize_ult_section();
|
||||
|
||||
});
|
||||
resize_ult_section();
|
||||
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
jQuery(".ult_exp_section").select(function(){
|
||||
|
||||
//console.log("jo");
|
||||
var ht=jQuery(this).data("height");
|
||||
|
||||
if(ht!=0 ){
|
||||
var top = jQuery(this).offset().top;
|
||||
var ntop = parseInt(top) - ht;
|
||||
jQuery("html, body").animate({scrollTop : ntop}, 1200);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,723 @@
|
||||
/*! fixto - v0.4.0 - 2015-06-08
|
||||
* http://github.com/bbarakaci/fixto/*/
|
||||
|
||||
|
||||
var fixto = (function ($, window, document) {
|
||||
|
||||
// Start Computed Style. Please do not modify this module here. Modify it from its own repo. See address below.
|
||||
|
||||
/*! Computed Style - v0.1.0 - 2012-07-19
|
||||
* https://github.com/bbarakaci/computed-style
|
||||
* Copyright (c) 2012 Burak Barakaci; Licensed MIT */
|
||||
var computedStyle = (function() {
|
||||
var computedStyle = {
|
||||
getAll : function(element){
|
||||
return document.defaultView.getComputedStyle(element);
|
||||
},
|
||||
get : function(element, name){
|
||||
return this.getAll(element)[name];
|
||||
},
|
||||
toFloat : function(value){
|
||||
return parseFloat(value, 10) || 0;
|
||||
},
|
||||
getFloat : function(element,name){
|
||||
return this.toFloat(this.get(element, name));
|
||||
},
|
||||
_getAllCurrentStyle : function(element) {
|
||||
return element.currentStyle;
|
||||
}
|
||||
};
|
||||
|
||||
if (document.documentElement.currentStyle) {
|
||||
computedStyle.getAll = computedStyle._getAllCurrentStyle;
|
||||
}
|
||||
|
||||
return computedStyle;
|
||||
|
||||
}());
|
||||
|
||||
// End Computed Style. Modify whatever you want to.
|
||||
|
||||
var mimicNode = (function(){
|
||||
/*
|
||||
Class Mimic Node
|
||||
Dependency : Computed Style
|
||||
Tries to mimick a dom node taking his styles, dimensions. May go to his repo if gets mature.
|
||||
*/
|
||||
|
||||
function MimicNode(element) {
|
||||
this.element = element;
|
||||
this.replacer = document.createElement('div');
|
||||
this.replacer.style.visibility = 'hidden';
|
||||
this.hide();
|
||||
element.parentNode.insertBefore(this.replacer, element);
|
||||
}
|
||||
|
||||
MimicNode.prototype = {
|
||||
replace : function(){
|
||||
var rst = this.replacer.style;
|
||||
var styles = computedStyle.getAll(this.element);
|
||||
|
||||
// rst.width = computedStyle.width(this.element) + 'px';
|
||||
// rst.height = this.element.offsetHeight + 'px';
|
||||
|
||||
// Setting offsetWidth
|
||||
rst.width = this._width();
|
||||
rst.height = this._height();
|
||||
|
||||
// Adopt margins
|
||||
rst.marginTop = styles.marginTop;
|
||||
rst.marginBottom = styles.marginBottom;
|
||||
rst.marginLeft = styles.marginLeft;
|
||||
rst.marginRight = styles.marginRight;
|
||||
|
||||
// Adopt positioning
|
||||
rst.cssFloat = styles.cssFloat;
|
||||
rst.styleFloat = styles.styleFloat; //ie8;
|
||||
rst.position = styles.position;
|
||||
rst.top = styles.top;
|
||||
rst.right = styles.right;
|
||||
rst.bottom = styles.bottom;
|
||||
rst.left = styles.left;
|
||||
// rst.borderStyle = styles.borderStyle;
|
||||
|
||||
rst.display = styles.display;
|
||||
|
||||
},
|
||||
|
||||
hide: function () {
|
||||
this.replacer.style.display = 'none';
|
||||
},
|
||||
|
||||
_width : function(){
|
||||
return this.element.getBoundingClientRect().width + 'px';
|
||||
},
|
||||
|
||||
_widthOffset : function(){
|
||||
return this.element.offsetWidth + 'px';
|
||||
},
|
||||
|
||||
_height : function(){
|
||||
return this.element.getBoundingClientRect().height + 'px';
|
||||
},
|
||||
|
||||
_heightOffset : function(){
|
||||
return this.element.offsetHeight + 'px';
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
$(this.replacer).remove();
|
||||
|
||||
// set properties to null to break references
|
||||
for (var prop in this) {
|
||||
if (this.hasOwnProperty(prop)) {
|
||||
this[prop] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var bcr = document.documentElement.getBoundingClientRect();
|
||||
if(!bcr.width){
|
||||
MimicNode.prototype._width = MimicNode.prototype._widthOffset;
|
||||
MimicNode.prototype._height = MimicNode.prototype._heightOffset;
|
||||
}
|
||||
|
||||
return {
|
||||
MimicNode:MimicNode,
|
||||
computedStyle:computedStyle
|
||||
};
|
||||
}());
|
||||
|
||||
// Class handles vendor prefixes
|
||||
function Prefix() {
|
||||
// Cached vendor will be stored when it is detected
|
||||
this._vendor = null;
|
||||
|
||||
//this._dummy = document.createElement('div');
|
||||
}
|
||||
|
||||
Prefix.prototype = {
|
||||
|
||||
_vendors: {
|
||||
webkit: { cssPrefix: '-webkit-', jsPrefix: 'Webkit'},
|
||||
moz: { cssPrefix: '-moz-', jsPrefix: 'Moz'},
|
||||
ms: { cssPrefix: '-ms-', jsPrefix: 'ms'},
|
||||
opera: { cssPrefix: '-o-', jsPrefix: 'O'}
|
||||
},
|
||||
|
||||
_prefixJsProperty: function(vendor, prop) {
|
||||
return vendor.jsPrefix + prop[0].toUpperCase() + prop.substr(1);
|
||||
},
|
||||
|
||||
_prefixValue: function(vendor, value) {
|
||||
return vendor.cssPrefix + value;
|
||||
},
|
||||
|
||||
_valueSupported: function(prop, value, dummy) {
|
||||
// IE8 will throw Illegal Argument when you attempt to set a not supported value.
|
||||
try {
|
||||
dummy.style[prop] = value;
|
||||
return dummy.style[prop] === value;
|
||||
}
|
||||
catch(er) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if the property is supported
|
||||
* @param {string} prop Property name
|
||||
* @returns {boolean}
|
||||
*/
|
||||
propertySupported: function(prop) {
|
||||
// Supported property will return either inine style value or an empty string.
|
||||
// Undefined means property is not supported.
|
||||
return document.documentElement.style[prop] !== undefined;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns prefixed property name for js usage
|
||||
* @param {string} prop Property name
|
||||
* @returns {string|null}
|
||||
*/
|
||||
getJsProperty: function(prop) {
|
||||
// Try native property name first.
|
||||
if(this.propertySupported(prop)) {
|
||||
return prop;
|
||||
}
|
||||
|
||||
// Prefix it if we know the vendor already
|
||||
if(this._vendor) {
|
||||
return this._prefixJsProperty(this._vendor, prop);
|
||||
}
|
||||
|
||||
// We don't know the vendor, try all the possibilities
|
||||
var prefixed;
|
||||
for(var vendor in this._vendors) {
|
||||
prefixed = this._prefixJsProperty(this._vendors[vendor], prop);
|
||||
if(this.propertySupported(prefixed)) {
|
||||
// Vendor detected. Cache it.
|
||||
this._vendor = this._vendors[vendor];
|
||||
return prefixed;
|
||||
}
|
||||
}
|
||||
|
||||
// Nothing worked
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns supported css value for css property. Could be used to check support or get prefixed value string.
|
||||
* @param {string} prop Property
|
||||
* @param {string} value Value name
|
||||
* @returns {string|null}
|
||||
*/
|
||||
getCssValue: function(prop, value) {
|
||||
// Create dummy element to test value
|
||||
var dummy = document.createElement('div');
|
||||
|
||||
// Get supported property name
|
||||
var jsProperty = this.getJsProperty(prop);
|
||||
|
||||
// Try unprefixed value
|
||||
if(this._valueSupported(jsProperty, value, dummy)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
var prefixedValue;
|
||||
|
||||
// If we know the vendor already try prefixed value
|
||||
if(this._vendor) {
|
||||
prefixedValue = this._prefixValue(this._vendor, value);
|
||||
if(this._valueSupported(jsProperty, prefixedValue, dummy)) {
|
||||
return prefixedValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Try all vendors
|
||||
for(var vendor in this._vendors) {
|
||||
prefixedValue = this._prefixValue(this._vendors[vendor], value);
|
||||
if(this._valueSupported(jsProperty, prefixedValue, dummy)) {
|
||||
// Vendor detected. Cache it.
|
||||
this._vendor = this._vendors[vendor];
|
||||
return prefixedValue;
|
||||
}
|
||||
}
|
||||
// No support for value
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
var prefix = new Prefix();
|
||||
|
||||
// We will need this frequently. Lets have it as a global until we encapsulate properly.
|
||||
var transformJsProperty = prefix.getJsProperty('transform');
|
||||
|
||||
// Will hold if browser creates a positioning context for fixed elements.
|
||||
var fixedPositioningContext;
|
||||
|
||||
// Checks if browser creates a positioning context for fixed elements.
|
||||
// Transform rule will create a positioning context on browsers who follow the spec.
|
||||
// Ie for example will fix it according to documentElement
|
||||
// TODO: Other css rules also effects. perspective creates at chrome but not in firefox. transform-style preserve3d effects.
|
||||
function checkFixedPositioningContextSupport() {
|
||||
var support = false;
|
||||
var parent = document.createElement('div');
|
||||
var child = document.createElement('div');
|
||||
parent.appendChild(child);
|
||||
parent.style[transformJsProperty] = 'translate(0)';
|
||||
// Make sure there is space on top of parent
|
||||
parent.style.marginTop = '10px';
|
||||
parent.style.visibility = 'hidden';
|
||||
child.style.position = 'fixed';
|
||||
child.style.top = 0;
|
||||
document.body.appendChild(parent);
|
||||
var rect = child.getBoundingClientRect();
|
||||
// If offset top is greater than 0 meand transformed element created a positioning context.
|
||||
if(rect.top > 0) {
|
||||
support = true;
|
||||
}
|
||||
// Remove dummy content
|
||||
document.body.removeChild(parent);
|
||||
return support;
|
||||
}
|
||||
|
||||
// It will return null if position sticky is not supported
|
||||
var nativeStickyValue = prefix.getCssValue('position', 'sticky');
|
||||
|
||||
// It will return null if position fixed is not supported
|
||||
var fixedPositionValue = prefix.getCssValue('position', 'fixed');
|
||||
|
||||
// Dirty business
|
||||
var ie = navigator.appName === 'Microsoft Internet Explorer';
|
||||
var ieversion;
|
||||
|
||||
if(ie){
|
||||
ieversion = parseFloat(navigator.appVersion.split("MSIE")[1]);
|
||||
}
|
||||
|
||||
function FixTo(child, parent, options) {
|
||||
this.child = child;
|
||||
this._$child = $(child);
|
||||
this.parent = parent;
|
||||
this.options = {
|
||||
className: 'fixto-fixed',
|
||||
top: 0
|
||||
};
|
||||
this._setOptions(options);
|
||||
}
|
||||
|
||||
FixTo.prototype = {
|
||||
// Returns the total outerHeight of the elements passed to mind option. Will return 0 if none.
|
||||
_mindtop: function () {
|
||||
var top = 0;
|
||||
if(this._$mind) {
|
||||
var el;
|
||||
var rect;
|
||||
var height;
|
||||
for(var i=0, l=this._$mind.length; i<l; i++) {
|
||||
el = this._$mind[i];
|
||||
rect = el.getBoundingClientRect();
|
||||
if(rect.height) {
|
||||
top += rect.height;
|
||||
}
|
||||
else {
|
||||
var styles = computedStyle.getAll(el);
|
||||
top += el.offsetHeight + computedStyle.toFloat(styles.marginTop) + computedStyle.toFloat(styles.marginBottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
return top;
|
||||
},
|
||||
|
||||
// Public method to stop the behaviour of this instance.
|
||||
stop: function () {
|
||||
this._stop();
|
||||
this._running = false;
|
||||
},
|
||||
|
||||
// Public method starts the behaviour of this instance.
|
||||
start: function () {
|
||||
|
||||
// Start only if it is not running not to attach event listeners multiple times.
|
||||
if(!this._running) {
|
||||
this._start();
|
||||
this._running = true;
|
||||
}
|
||||
},
|
||||
|
||||
//Public method to destroy fixto behaviour
|
||||
destroy: function () {
|
||||
this.stop();
|
||||
|
||||
this._destroy();
|
||||
|
||||
// Remove jquery data from the element
|
||||
this._$child.removeData('fixto-instance');
|
||||
|
||||
// set properties to null to break references
|
||||
for (var prop in this) {
|
||||
if (this.hasOwnProperty(prop)) {
|
||||
this[prop] = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_setOptions: function(options) {
|
||||
$.extend(this.options, options);
|
||||
if(this.options.mind) {
|
||||
this._$mind = $(this.options.mind);
|
||||
}
|
||||
if(this.options.zIndex) {
|
||||
this.child.style.zIndex = this.options.zIndex;
|
||||
}
|
||||
},
|
||||
|
||||
setOptions: function(options) {
|
||||
this._setOptions(options);
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
// Methods could be implemented by subclasses
|
||||
|
||||
_stop: function() {
|
||||
|
||||
},
|
||||
|
||||
_start: function() {
|
||||
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// Class FixToContainer
|
||||
function FixToContainer(child, parent, options) {
|
||||
FixTo.call(this, child, parent, options);
|
||||
this._replacer = new mimicNode.MimicNode(child);
|
||||
this._ghostNode = this._replacer.replacer;
|
||||
|
||||
this._saveStyles();
|
||||
|
||||
this._saveViewportHeight();
|
||||
|
||||
// Create anonymous functions and keep references to register and unregister events.
|
||||
this._proxied_onscroll = this._bind(this._onscroll, this);
|
||||
this._proxied_onresize = this._bind(this._onresize, this);
|
||||
|
||||
this.start();
|
||||
}
|
||||
|
||||
FixToContainer.prototype = new FixTo();
|
||||
|
||||
$.extend(FixToContainer.prototype, {
|
||||
|
||||
// Returns an anonymous function that will call the given function in the given context
|
||||
_bind : function (fn, context) {
|
||||
return function () {
|
||||
return fn.call(context);
|
||||
};
|
||||
},
|
||||
|
||||
// at ie8 maybe only in vm window resize event fires everytime an element is resized.
|
||||
_toresize : ieversion===8 ? document.documentElement : window,
|
||||
|
||||
_onscroll: function _onscroll() {
|
||||
this._scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
this._parentBottom = (this.parent.offsetHeight + this._fullOffset('offsetTop', this.parent));
|
||||
|
||||
if (this.options.mindBottomPadding !== false) {
|
||||
this._parentBottom -= computedStyle.getFloat(this.parent, 'paddingBottom');
|
||||
}
|
||||
|
||||
if (!this.fixed) {
|
||||
|
||||
var childStyles = computedStyle.getAll(this.child);
|
||||
|
||||
if (
|
||||
this._scrollTop < this._parentBottom &&
|
||||
this._scrollTop > (this._fullOffset('offsetTop', this.child) - this.options.top - this._mindtop()) &&
|
||||
this._viewportHeight > (this.child.offsetHeight + computedStyle.toFloat(childStyles.marginTop) + computedStyle.toFloat(childStyles.marginBottom))
|
||||
) {
|
||||
|
||||
this._fix();
|
||||
this._adjust();
|
||||
}
|
||||
} else {
|
||||
if (this._scrollTop > this._parentBottom || this._scrollTop < (this._fullOffset('offsetTop', this._ghostNode) - this.options.top - this._mindtop())) {
|
||||
this._unfix();
|
||||
return;
|
||||
}
|
||||
this._adjust();
|
||||
}
|
||||
},
|
||||
|
||||
_adjust: function _adjust() {
|
||||
var top = 0;
|
||||
var mindTop = this._mindtop();
|
||||
var diff = 0;
|
||||
var childStyles = computedStyle.getAll(this.child);
|
||||
var context = null;
|
||||
|
||||
if(fixedPositioningContext) {
|
||||
// Get positioning context.
|
||||
context = this._getContext();
|
||||
if(context) {
|
||||
// There is a positioning context. Top should be according to the context.
|
||||
if (context.getBoundingClientRect().top > 0) {
|
||||
top = top - context.getBoundingClientRect().top;
|
||||
}else{
|
||||
top = Math.abs(context.getBoundingClientRect().top);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
diff = (this._parentBottom - this._scrollTop) - (this.child.offsetHeight + computedStyle.toFloat(childStyles.marginBottom) + mindTop + this.options.top);
|
||||
|
||||
if(diff>0) {
|
||||
diff = 0;
|
||||
}
|
||||
|
||||
this.child.style.top = (diff + mindTop + top + this.options.top) - computedStyle.toFloat(childStyles.marginTop) + 'px';
|
||||
},
|
||||
|
||||
// Calculate cumulative offset of the element.
|
||||
// Optionally according to context
|
||||
_fullOffset: function _fullOffset(offsetName, elm, context) {
|
||||
var offset = elm[offsetName];
|
||||
var offsetParent = elm.offsetParent;
|
||||
|
||||
// Add offset of the ascendent tree until we reach to the document root or to the given context
|
||||
while (offsetParent !== null && offsetParent !== context) {
|
||||
offset = offset + offsetParent[offsetName];
|
||||
offsetParent = offsetParent.offsetParent;
|
||||
}
|
||||
|
||||
return offset;
|
||||
},
|
||||
|
||||
// Get positioning context of the element.
|
||||
// We know that the closest parent that a transform rule applied will create a positioning context.
|
||||
_getContext: function() {
|
||||
var parent;
|
||||
var element = this.child;
|
||||
var context = null;
|
||||
var styles;
|
||||
|
||||
// Climb up the treee until reaching the context
|
||||
while(!context) {
|
||||
parent = element.parentNode;
|
||||
if(parent === document.documentElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
styles = computedStyle.getAll(parent);
|
||||
// Element has a transform rule
|
||||
if(styles[transformJsProperty] !== 'none') {
|
||||
context = parent;
|
||||
break;
|
||||
}
|
||||
element = parent;
|
||||
}
|
||||
return context;
|
||||
},
|
||||
|
||||
_fix: function _fix() {
|
||||
var child = this.child;
|
||||
var childStyle = child.style;
|
||||
var childStyles = computedStyle.getAll(child);
|
||||
var left = child.getBoundingClientRect().left;
|
||||
var width = childStyles.width;
|
||||
|
||||
this._saveStyles();
|
||||
|
||||
if(document.documentElement.currentStyle){
|
||||
// Function for ie<9. When hasLayout is not triggered in ie7, he will report currentStyle as auto, clientWidth as 0. Thus using offsetWidth.
|
||||
// Opera also falls here
|
||||
width = (child.offsetWidth) - (computedStyle.toFloat(childStyles.paddingLeft) + computedStyle.toFloat(childStyles.paddingRight) + computedStyle.toFloat(childStyles.borderLeftWidth) + computedStyle.toFloat(childStyles.borderRightWidth)) + 'px';
|
||||
}
|
||||
|
||||
// Ie still fixes the container according to the viewport.
|
||||
if(fixedPositioningContext) {
|
||||
var context = this._getContext();
|
||||
if(context) {
|
||||
// There is a positioning context. Left should be according to the context.
|
||||
left = child.getBoundingClientRect().left - context.getBoundingClientRect().left;
|
||||
}
|
||||
}
|
||||
|
||||
this._replacer.replace();
|
||||
|
||||
childStyle.left = (left - computedStyle.toFloat(childStyles.marginLeft)) + 'px';
|
||||
childStyle.width = width;
|
||||
|
||||
childStyle.position = 'fixed';
|
||||
childStyle.top = this._mindtop() + this.options.top - computedStyle.toFloat(childStyles.marginTop) + 'px';
|
||||
this._$child.addClass(this.options.className);
|
||||
this.fixed = true;
|
||||
},
|
||||
|
||||
_unfix: function _unfix() {
|
||||
var childStyle = this.child.style;
|
||||
this._replacer.hide();
|
||||
childStyle.position = this._childOriginalPosition;
|
||||
childStyle.top = this._childOriginalTop;
|
||||
childStyle.width = this._childOriginalWidth;
|
||||
childStyle.left = this._childOriginalLeft;
|
||||
this._$child.removeClass(this.options.className);
|
||||
this.fixed = false;
|
||||
},
|
||||
|
||||
_saveStyles: function(){
|
||||
var childStyle = this.child.style;
|
||||
this._childOriginalPosition = childStyle.position;
|
||||
this._childOriginalTop = childStyle.top;
|
||||
this._childOriginalWidth = childStyle.width;
|
||||
this._childOriginalLeft = childStyle.left;
|
||||
},
|
||||
|
||||
_onresize: function () {
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
_saveViewportHeight: function () {
|
||||
// ie8 doesn't support innerHeight
|
||||
this._viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
||||
},
|
||||
|
||||
_stop: function() {
|
||||
// Unfix the container immediately.
|
||||
this._unfix();
|
||||
// remove event listeners
|
||||
$(window).unbind('scroll', this._proxied_onscroll);
|
||||
$(this._toresize).unbind('resize', this._proxied_onresize);
|
||||
},
|
||||
|
||||
_start: function() {
|
||||
// Trigger onscroll to have the effect immediately.
|
||||
this._onscroll();
|
||||
|
||||
// Attach event listeners
|
||||
$(window).bind('scroll', this._proxied_onscroll);
|
||||
$(this._toresize).bind('resize', this._proxied_onresize);
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
// Destroy mimic node instance
|
||||
this._replacer.destroy();
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
this._saveViewportHeight();
|
||||
this._unfix();
|
||||
this._onscroll();
|
||||
}
|
||||
});
|
||||
|
||||
function NativeSticky(child, parent, options) {
|
||||
FixTo.call(this, child, parent, options);
|
||||
this.start();
|
||||
}
|
||||
|
||||
NativeSticky.prototype = new FixTo();
|
||||
|
||||
$.extend(NativeSticky.prototype, {
|
||||
_start: function() {
|
||||
|
||||
var childStyles = computedStyle.getAll(this.child);
|
||||
|
||||
this._childOriginalPosition = childStyles.position;
|
||||
this._childOriginalTop = childStyles.top;
|
||||
|
||||
this.child.style.position = nativeStickyValue;
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
_stop: function() {
|
||||
this.child.style.position = this._childOriginalPosition;
|
||||
this.child.style.top = this._childOriginalTop;
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
this.child.style.top = this._mindtop() + this.options.top + 'px';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
var fixTo = function fixTo(childElement, parentElement, options) {
|
||||
if((nativeStickyValue && !options) || (nativeStickyValue && options && options.useNativeSticky !== false)) {
|
||||
// Position sticky supported and user did not disabled the usage of it.
|
||||
return new NativeSticky(childElement, parentElement, options);
|
||||
}
|
||||
else if(fixedPositionValue) {
|
||||
// Position fixed supported
|
||||
|
||||
if(fixedPositioningContext===undefined) {
|
||||
// We don't know yet if browser creates fixed positioning contexts. Check it.
|
||||
fixedPositioningContext = checkFixedPositioningContextSupport();
|
||||
}
|
||||
|
||||
return new FixToContainer(childElement, parentElement, options);
|
||||
}
|
||||
else {
|
||||
return 'Neither fixed nor sticky positioning supported';
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
No support for ie lt 8
|
||||
*/
|
||||
|
||||
if(ieversion<8){
|
||||
fixTo = function(){
|
||||
return 'not supported';
|
||||
};
|
||||
}
|
||||
|
||||
// Let it be a jQuery Plugin
|
||||
$.fn.fixTo = function (targetSelector, options) {
|
||||
|
||||
var $targets = $(targetSelector);
|
||||
|
||||
var i = 0;
|
||||
return this.each(function () {
|
||||
|
||||
// Check the data of the element.
|
||||
var instance = $(this).data('fixto-instance');
|
||||
|
||||
// If the element is not bound to an instance, create the instance and save it to elements data.
|
||||
if(!instance) {
|
||||
$(this).data('fixto-instance', fixTo(this, $targets[i], options));
|
||||
}
|
||||
else {
|
||||
// If we already have the instance here, expect that targetSelector parameter will be a string
|
||||
// equal to a public methods name. Run the method on the instance without checking if
|
||||
// it exists or it is a public method or not. Cause nasty errors when necessary.
|
||||
var method = targetSelector;
|
||||
instance[method].call(instance, options);
|
||||
}
|
||||
i++;
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
Expose
|
||||
*/
|
||||
|
||||
return {
|
||||
FixToContainer: FixToContainer,
|
||||
fixTo: fixTo,
|
||||
computedStyle:computedStyle,
|
||||
mimicNode:mimicNode
|
||||
};
|
||||
|
||||
|
||||
}(window.jQuery, window, document));
|
||||
@@ -0,0 +1,187 @@
|
||||
;(function ($, window, undefined) {
|
||||
|
||||
$(window).load(function (a) {
|
||||
flip_box_set_auto_height();
|
||||
});
|
||||
|
||||
$(document).ready(function (a) {
|
||||
flip_box_set_auto_height();
|
||||
});
|
||||
|
||||
$(window).resize(function (a) {
|
||||
flip_box_set_auto_height();
|
||||
});
|
||||
|
||||
function flip_box_set_auto_height() {
|
||||
|
||||
$('.flip-box').each(function (index, value) {
|
||||
|
||||
var bodywidth = $(document).width();
|
||||
var WW = window.innerWidth;
|
||||
|
||||
if (WW != '') {
|
||||
|
||||
// For desktops
|
||||
if (WW >= 768) {
|
||||
|
||||
var h = $(this).attr('data-min-height') || '';
|
||||
|
||||
if (h != '') {
|
||||
|
||||
if ($(this).hasClass("ifb-custom-height")) {
|
||||
|
||||
$(this).css('min-height', h);
|
||||
$(this).css('height', h);
|
||||
|
||||
if ($(this).find(".ifb-back").find(".ifb-flip-box-section").hasClass("ifb-flip-box-section-vertical-middle")) {
|
||||
|
||||
var back = $(this).find(".ifb-back").outerHeight();
|
||||
var backsection = $(this).find(".ifb-back").find(".ifb-flip-box-section").outerHeight();
|
||||
|
||||
back = parseInt(h);
|
||||
backsection = parseInt(backsection);
|
||||
|
||||
//
|
||||
if (backsection >= back) {
|
||||
$(this).find(".ifb-back").find(".ifb-flip-box-section").addClass("ifb_disable_middle");
|
||||
}
|
||||
}
|
||||
|
||||
if ($(this).find(".ifb-front").find(".ifb-flip-box-section").hasClass("ifb-flip-box-section-vertical-middle")) {
|
||||
|
||||
var front = $(this).find(".ifb-front").outerHeight();
|
||||
front = parseInt(h);
|
||||
var frontsection = $(this).find(".ifb-front").find(".ifb-flip-box-section").outerHeight();
|
||||
frontsection = parseInt(frontsection);
|
||||
|
||||
if (frontsection >= front) {
|
||||
$(this).find(".ifb-front").find(".ifb-flip-box-section").addClass("ifb_disable_middle");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if ($(this).hasClass("ifb-jq-height")) {
|
||||
|
||||
var ht1 = $(this).find(".ifb-back").find(".ifb-flip-box-section").outerHeight();
|
||||
ht1 = parseInt(ht1);
|
||||
var ht2 = $(this).find(".ifb-front").find(".ifb-flip-box-section").outerHeight();
|
||||
ht2 = parseInt(ht2);
|
||||
|
||||
if (ht1 >= ht2) {
|
||||
$(this).find(".ifb-face").css('height', ht1);
|
||||
}
|
||||
else {
|
||||
$(this).find(".ifb-face").css('height', ht2);
|
||||
}
|
||||
}
|
||||
else if ($(this).hasClass("ifb-auto-height")) {
|
||||
|
||||
if ($(this).find(".ifb-back").find(".ifb-flip-box-section").hasClass("ifb-flip-box-section-vertical-middle")) {
|
||||
|
||||
var back = $(this).find(".ifb-back").outerHeight();
|
||||
back = parseInt(back);
|
||||
var backsection = $(this).find(".ifb-back").find(".ifb-flip-box-section").outerHeight();
|
||||
backsection = parseInt(backsection);
|
||||
|
||||
if (backsection >= back) {
|
||||
$(this).find(".ifb-back").find(".ifb-flip-box-section").addClass("ifb_disable_middle");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// For Mobiles
|
||||
else {
|
||||
|
||||
var h = $(this).attr('data-min-height') || '';
|
||||
// for style - 9
|
||||
if ($(this).hasClass('style_9')) {
|
||||
|
||||
$(this).css('height', 'initial');
|
||||
var f1 = $(this).find('.ifb-front-1 .ifb-front').outerHeight();
|
||||
var f2 = $(this).find('.ifb-back-1 .ifb-back').outerHeight();
|
||||
// set largest height - of either front or back
|
||||
if (f1 > f2) {
|
||||
$(this).css('height', f1);
|
||||
} else {
|
||||
$(this).css('height', f2);
|
||||
}
|
||||
} else {
|
||||
|
||||
if ($(this).hasClass("ifb-jq-height")) {
|
||||
|
||||
var ht1 = $(this).find(".ifb-back").find(".ifb-flip-box-section").outerHeight();
|
||||
ht1 = parseInt(ht1);
|
||||
var ht2 = $(this).find(".ifb-front").find(".ifb-flip-box-section").outerHeight();
|
||||
ht2 = parseInt(ht2);
|
||||
if (ht1 >= ht2) {
|
||||
$(this).find(".ifb-face").css('height', ht1);
|
||||
}
|
||||
else {
|
||||
$(this).find(".ifb-face").css('height', ht2);
|
||||
}
|
||||
}
|
||||
else if ($(this).hasClass("ifb-auto-height")) {
|
||||
|
||||
if ($(this).find(".ifb-back").find(".ifb-flip-box-section").hasClass("ifb-flip-box-section-vertical-middle")) {
|
||||
|
||||
var back = $(this).find(".ifb-back").outerHeight();
|
||||
var backsection = $(this).find(".ifb-back").find(".ifb-flip-box-section").outerHeight();
|
||||
|
||||
back = parseInt(back);
|
||||
backsection = parseInt(backsection);
|
||||
|
||||
if (backsection > back) {
|
||||
$(this).find(".ifb-back").find(".ifb-flip-box-section").addClass("ifb_disable_middle");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if ($(this).hasClass("ifb-custom-height")) {
|
||||
|
||||
if (h != '') {
|
||||
|
||||
$(this).css('min-height', h);
|
||||
$(this).css('height', h);
|
||||
if ($(this).find(".ifb-back").find(".ifb-flip-box-section").hasClass("ifb-flip-box-section-vertical-middle")) {
|
||||
|
||||
var back = $(this).find(".ifb-back").outerHeight();
|
||||
back = parseInt(back);
|
||||
var backsection = $(this).find(".ifb-back").find(".ifb-flip-box-section").outerHeight();
|
||||
backsection = parseInt(backsection);
|
||||
|
||||
if (backsection >= back) {
|
||||
$(this).find(".ifb-back").find(".ifb-flip-box-section").addClass("ifb_disable_middle");
|
||||
}
|
||||
}
|
||||
|
||||
if ($(this).find(".ifb-front").find(".ifb-flip-box-section").hasClass("ifb-flip-box-section-vertical-middle")) {
|
||||
|
||||
var front = $(this).find(".ifb-front").outerHeight();
|
||||
front = parseInt(front);
|
||||
var frontsection = $(this).find(".ifb-front").find(".ifb-flip-box-section").outerHeight();
|
||||
frontsection = parseInt(frontsection);
|
||||
|
||||
if (frontsection >= front) {
|
||||
$(this).find(".ifb-front").find(".ifb-flip-box-section").addClass("ifb_disable_middle");
|
||||
}
|
||||
else {
|
||||
$(this).find(".ifb-front").find(".ifb-flip-box-section").addClass("ifb_disable_middle");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(this).css('height', 'initial');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}(jQuery, window));
|
||||
@@ -0,0 +1 @@
|
||||
var Froogaloop=function(){function e(a){return new e.fn.init(a)}function h(a,c,b){if(!b.contentWindow.postMessage)return!1;var f=b.getAttribute("src").split("?")[0],a=JSON.stringify({method:a,value:c});"//"===f.substr(0,2)&&(f=window.location.protocol+f);b.contentWindow.postMessage(a,f)}function j(a){var c,b;try{c=JSON.parse(a.data),b=c.event||c.method}catch(f){}"ready"==b&&!i&&(i=!0);if(a.origin!=k)return!1;var a=c.value,e=c.data,g=""===g?null:c.player_id;c=g?d[g][b]:d[b];b=[];if(!c)return!1;void 0!==␍a&&b.push(a);e&&b.push(e);g&&b.push(g);return 0<b.length?c.apply(null,b):c.call()}function l(a,c,b){b?(d[b]||(d[b]={}),d[b][a]=c):d[a]=c}var d={},i=!1,k="";e.fn=e.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;a=this.element.getAttribute("src");"//"===a.substr(0,2)&&(a=window.location.protocol+a);for(var a=a.split("/"),c="",b=0,f=a.length;b<f;b++){if(3>b)c+=a[b];else break;2>b&&(c+="/")}k=c;return this},api:function(a,c){if(!this.element||␍!a)return!1;var b=this.element,f=""!==b.id?b.id:null,d=!c||!c.constructor||!c.call||!c.apply?c:null,e=c&&c.constructor&&c.call&&c.apply?c:null;e&&l(a,e,f);h(a,d,b);return this},addEvent:function(a,c){if(!this.element)return!1;var b=this.element,d=""!==b.id?b.id:null;l(a,c,d);"ready"!=a?h("addEventListener",a,b):"ready"==a&&i&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b;a:{if((b=""!==c.id?c.id:null)&&d[b]){if(!d[b][a]){b=!1;break a}d[b][a]=null}else{if(!d[a]){b=␍!1;break a}d[a]=null}b=!0}"ready"!=a&&b&&h("removeEventListener",a,c)}};e.fn.init.prototype=e.fn;window.addEventListener?window.addEventListener("message",j,!1):window.attachEvent("onmessage",j);return window.Froogaloop=window.$f=e}();
|
||||
@@ -0,0 +1,127 @@
|
||||
(function($){
|
||||
$jh = $.noConflict();
|
||||
$jh(document).ready(function(e) {
|
||||
ultimate_headings_init();
|
||||
$jh(window).resize(function(e){
|
||||
ultimate_headings_init();
|
||||
});
|
||||
});
|
||||
$(window).load(function(e) {
|
||||
ultimate_headings_init();
|
||||
//trigger on click of exp section
|
||||
jQuery(".ult_exp_section").select(function(){
|
||||
|
||||
var slength=jQuery(this).parent().find('.uvc-heading').length;
|
||||
if(slength>0)
|
||||
{
|
||||
ultimate_headings_init();
|
||||
}
|
||||
});
|
||||
});
|
||||
function ultimate_headings_init()
|
||||
{
|
||||
var fixer = 0;
|
||||
$jh('.uvc-heading').each(function(){
|
||||
var icon_height, icon_width, line_width;
|
||||
var wrapper_width = $jh(this).outerWidth();
|
||||
var hline_width = $jh(this).attr('data-hline_width');
|
||||
var icon_type = $jh(this).attr('data-hicon_type');
|
||||
var align = $jh(this).attr('data-halign');
|
||||
var spacer = $jh(this).attr('data-hspacer');
|
||||
|
||||
left_rtl = 'left';
|
||||
right_rtl = 'right';
|
||||
if ( jQuery( 'body' ).hasClass('rtl') ) {
|
||||
left_rtl = 'right';
|
||||
right_rtl = 'left';
|
||||
}
|
||||
|
||||
if(spacer == 'line_with_icon')
|
||||
{
|
||||
var id = $jh(this).attr('id');
|
||||
fixer = $jh(this).attr('data-hfixer');
|
||||
if(typeof fixer === 'undefined' || fixer === '')
|
||||
fixer = 0;
|
||||
else
|
||||
fixer = parseInt(fixer);
|
||||
var mid_wrapper_width = (wrapper_width/2);
|
||||
$jh(this).find('.dynamic_ultimate_heading_css').remove();
|
||||
if(hline_width == 'auto' || hline_width>wrapper_width)
|
||||
line_width = wrapper_width;
|
||||
else
|
||||
line_width = hline_width;
|
||||
var mid_line_width = line_width/2;
|
||||
if(icon_type == 'selector')
|
||||
{
|
||||
icon_width = $jh(this).find('.aio-icon').outerWidth();
|
||||
icon_height = $jh(this).find('.aio-icon').outerHeight();
|
||||
}
|
||||
else
|
||||
{
|
||||
icon_width = $jh(this).find('.aio-icon-img').outerWidth();
|
||||
icon_height = $jh(this).find('.aio-icon-img').outerHeight();
|
||||
}
|
||||
|
||||
var mid_icon_width = (icon_width/2);
|
||||
|
||||
var line_pos = (mid_wrapper_width - mid_icon_width)+icon_width+fixer;
|
||||
var cline_width = mid_line_width;
|
||||
/* add 3px extra spacing to fix {crop icon} issue */
|
||||
icon_height = icon_height+3;
|
||||
$jh(this).find('.uvc-heading-spacer').height(icon_height);
|
||||
if(align == 'center')
|
||||
{
|
||||
$jh(this).find('.aio-icon-img').css({'margin':'0 auto'});
|
||||
var border_css = '#'+id+' .uvc-heading-spacer.line_with_icon:before{'+ right_rtl +':'+line_pos+'px;}#'+id+' .uvc-heading-spacer.line_with_icon:after{'+ left_rtl +':'+line_pos+'px;}';
|
||||
}
|
||||
else if(align == 'left')
|
||||
{
|
||||
$jh(this).find('.aio-icon-img').css({'float':align});
|
||||
var border_css = '';
|
||||
if(line_width != '')
|
||||
{
|
||||
border_css = '#'+id+' .uvc-heading-spacer.line_with_icon:before{left:'+(icon_width+fixer)+'px;right:auto;}#'+id+' .uvc-heading-spacer.line_with_icon:after{left:'+(cline_width+icon_width+fixer)+'px;right:auto;}';
|
||||
}
|
||||
else
|
||||
{
|
||||
border_css = '#'+id+' .uvc-heading-spacer.line_with_icon:before{right:'+(line_pos-icon_width-(fixer*2))+'px;}#'+id+' .uvc-heading-spacer.line_with_icon:after{left:'+(line_pos-fixer)+'px;}';
|
||||
}
|
||||
}
|
||||
else if(align == 'right')
|
||||
{
|
||||
$jh(this).find('.aio-icon-img').css({'float':align});
|
||||
var border_css = '';
|
||||
if(line_width != '')
|
||||
{
|
||||
border_css = '#'+id+' .uvc-heading-spacer.line_with_icon:before{right:'+(icon_width+fixer)+'px;left:auto;}#'+id+' .uvc-heading-spacer.line_with_icon:after{right:'+(cline_width+icon_width+fixer)+'px;left:auto;}';
|
||||
}
|
||||
else
|
||||
{
|
||||
border_css = '#'+id+' .uvc-heading-spacer.line_with_icon:before{right:'+(line_pos-fixer)+'px;}#'+id+' .uvc-heading-spacer.line_with_icon:after{left:'+(line_pos-icon_width-(fixer*2))+'px;}';
|
||||
}
|
||||
}
|
||||
var border_style = $jh(this).attr('data-hborder_style');
|
||||
var border_color = $jh(this).attr('data-hborder_color');
|
||||
var border_height = $jh(this).attr('data-hborder_height');
|
||||
if(hline_width == 'auto')
|
||||
{
|
||||
if(align == 'center')
|
||||
cline_width = Math.floor(cline_width-icon_width+fixer);
|
||||
}
|
||||
var hstyle_spacer = '<div class="dynamic_ultimate_heading_css"><style>#'+id+' .uvc-heading-spacer.line_with_icon:before, #'+id+' .uvc-heading-spacer.line_with_icon:after{width:'+(cline_width)+'px;border-style:'+border_style+';border-color:'+border_color+';border-bottom-width:'+border_height+'px;}'+border_css+'</style></div>';
|
||||
$jh(this).prepend(hstyle_spacer);
|
||||
}
|
||||
else if(spacer == 'line_only')
|
||||
{
|
||||
if(align == 'right' || align == 'left')
|
||||
{
|
||||
$jh(this).find('.uvc-heading-spacer').find('.uvc-headings-line').css({'float':align});
|
||||
}
|
||||
else
|
||||
{
|
||||
$jh(this).find('.uvc-heading-spacer').find('.uvc-headings-line').css({'margin':'0 auto'});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,74 @@
|
||||
(function($) {
|
||||
$(document).ready(function(){
|
||||
|
||||
$(document).on("mouseenter", ".ultimate-call-to-action", function() {
|
||||
$(this).addClass('ultimate-call-to-action-hover');
|
||||
var hover = $(this).data('background-hover');
|
||||
$(this).css({'background-color':hover});
|
||||
});
|
||||
|
||||
$(document).on("mouseleave", ".ultimate-call-to-action", function() {
|
||||
$(this).removeClass('ultimate-call-to-action-hover');
|
||||
var background = $(this).data('background');
|
||||
$(this).css({'background-color':background});
|
||||
});
|
||||
|
||||
resize_call_to_action();
|
||||
|
||||
$(window).resize(function(){
|
||||
resize_call_to_action();
|
||||
});
|
||||
});
|
||||
|
||||
function resize_call_to_action()
|
||||
{
|
||||
$('.ultimate-call-to-action').each(function(i,element){
|
||||
var override = $(element).data('override');
|
||||
if(override != 0)
|
||||
{
|
||||
$(element).css({'margin-left' : 0 });
|
||||
var is_relative = 'true';
|
||||
if($(element).parents('.wpb_row').length > 0)
|
||||
var ancenstor = $(element).parents('.wpb_row');
|
||||
else if($(element).parents('.wpb_column').length > 0)
|
||||
var ancenstor = $(element).parents('.wpb_column');
|
||||
else
|
||||
var ancenstor = $(element).parent();
|
||||
|
||||
var parent = ancenstor;
|
||||
if(override=='full'){
|
||||
ancenstor= $('body');
|
||||
is_relative = 'false';
|
||||
}
|
||||
if(override=='ex-full'){
|
||||
ancenstor= $('html');
|
||||
is_relative = 'false';
|
||||
}
|
||||
if( ! isNaN(override)){
|
||||
for(var i=1;i<=override;i++){
|
||||
if(ancenstor.prop('tagName')!='HTML'){
|
||||
ancenstor = ancenstor.parent();
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var w = ancenstor.outerWidth();
|
||||
|
||||
var element_left = $(element).offset().left;
|
||||
var element_left_pos = $(element).position().left;
|
||||
var holder_left = ancenstor.offset().left;
|
||||
var holder_left_pos = ancenstor.position().left;
|
||||
var calculate_left = holder_left - element_left;
|
||||
|
||||
if(override!='full' && override!='ex-full')
|
||||
{
|
||||
calculate_left = holder_left - holder_left_pos;
|
||||
}
|
||||
|
||||
$(element).css({'width':w, 'margin-left' : calculate_left });
|
||||
}
|
||||
});
|
||||
}
|
||||
}( jQuery ));
|
||||
@@ -0,0 +1,980 @@
|
||||
/* Tooltipster v3.2.6 */ ;
|
||||
(function(e, t, n) {
|
||||
function s(t, n) {
|
||||
this.bodyOverflowX;
|
||||
this.callbacks = {
|
||||
hide: [],
|
||||
show: []
|
||||
};
|
||||
this.checkInterval = null;
|
||||
this.Content;
|
||||
this.$el = e(t);
|
||||
this.$elProxy;
|
||||
this.elProxyPosition;
|
||||
this.enabled = true;
|
||||
this.options = e.extend({}, i, n);
|
||||
this.mouseIsOverProxy = false;
|
||||
this.namespace = "ult-tooltipster-" + Math.round(Math.random() * 1e5);
|
||||
this.Status = "hidden";
|
||||
this.timerHide = null;
|
||||
this.timerShow = null;
|
||||
this.$tooltip;
|
||||
this.options.iconTheme = this.options.iconTheme.replace(".", "");
|
||||
this.options.theme = this.options.theme.replace(".", "");
|
||||
this._init()
|
||||
}
|
||||
|
||||
function o(t, n) {
|
||||
var r = true;
|
||||
e.each(t, function(e, i) {
|
||||
if (typeof n[e] === "undefined" || t[e] !== n[e]) {
|
||||
r = false;
|
||||
return false
|
||||
}
|
||||
});
|
||||
return r
|
||||
}
|
||||
|
||||
function f() {
|
||||
return !a && u
|
||||
}
|
||||
|
||||
function l() {
|
||||
var e = n.body || n.documentElement,
|
||||
t = e.style,
|
||||
r = "transition";
|
||||
if (typeof t[r] == "string") {
|
||||
return true
|
||||
}
|
||||
v = ["Moz", "Webkit", "Khtml", "O", "ms"], r = r.charAt(0).toUpperCase() + r.substr(1);
|
||||
for (var i = 0; i < v.length; i++) {
|
||||
if (typeof t[v[i] + r] == "string") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
var r = "ulttooltipster",
|
||||
i = {
|
||||
/*ultContentSize: "auto", /* ultimate */
|
||||
/*ultContainerWidth: "auto",*/ /* ultimate */
|
||||
animation: "fade",
|
||||
arrow: true,
|
||||
arrowColor: "",
|
||||
autoClose: true,
|
||||
content: null,
|
||||
contentAsHTML: false,
|
||||
contentCloning: true,
|
||||
debug: true,
|
||||
delay: 200,
|
||||
minWidth: 0,
|
||||
|
||||
ultCustomTooltipStyle: false,
|
||||
ultContentStyle: null,
|
||||
ultBaseStyle: null,
|
||||
|
||||
//ultContainerWidth: null,
|
||||
/*ultBaseWidth: null,
|
||||
ultPadding: null,*/
|
||||
//ultBaseBGColor: "#FF5F5F",
|
||||
//ultBaseBorderColor: "#D34646",
|
||||
//ultBaseColor: "#333333",
|
||||
maxWidth: null,
|
||||
functionInit: function(e, t) {},
|
||||
functionBefore: function(e, t) {
|
||||
t()
|
||||
},
|
||||
functionReady: function(e, t) {},
|
||||
functionAfter: function(e) {},
|
||||
icon: "(?)",
|
||||
iconCloning: true,
|
||||
iconDesktop: false,
|
||||
iconTouch: false,
|
||||
iconTheme: "ult-tooltipster-icon",
|
||||
interactive: false,
|
||||
interactiveTolerance: 350,
|
||||
multiple: false,
|
||||
offsetX: 0,
|
||||
offsetY: 0,
|
||||
onlyOne: false,
|
||||
position: "top",
|
||||
positionTracker: false,
|
||||
speed: 350,
|
||||
timer: 0,
|
||||
theme: "ult-tooltipster-default",
|
||||
touchDevices: true,
|
||||
trigger: "hover",
|
||||
updateAnimation: true,
|
||||
ult_adv_id: 0,
|
||||
ultimate_target: 0,
|
||||
responsive_json_new: 0,
|
||||
|
||||
};
|
||||
s.prototype = {
|
||||
_init: function() {
|
||||
var t = this;
|
||||
if (n.querySelector) {
|
||||
if (t.options.content !== null) {
|
||||
t._content_set(t.options.content)
|
||||
} else {
|
||||
var r = t.$el.attr("title");
|
||||
if (typeof r === "undefined") r = null;
|
||||
t._content_set(r)
|
||||
}
|
||||
var i = t.options.functionInit.call(t.$el, t.$el, t.Content);
|
||||
if (typeof i !== "undefined") t._content_set(i);
|
||||
t.$el.removeAttr("title").addClass("ult-tooltipstered");
|
||||
if (!u && t.options.iconDesktop || u && t.options.iconTouch) {
|
||||
if (typeof t.options.icon === "string") {
|
||||
t.$elProxy = e('<span class="' + t.options.iconTheme + '"></span>');
|
||||
t.$elProxy.text(t.options.icon)
|
||||
} else {
|
||||
if (t.options.iconCloning) t.$elProxy = t.options.icon.clone(true);
|
||||
else t.$elProxy = t.options.icon
|
||||
}
|
||||
t.$elProxy.insertAfter(t.$el)
|
||||
} else {
|
||||
t.$elProxy = t.$el
|
||||
}
|
||||
if (t.options.trigger == "hover") {
|
||||
t.$elProxy.on("mouseenter." + t.namespace, function() {
|
||||
if (!f() || t.options.touchDevices) {
|
||||
t.mouseIsOverProxy = true;
|
||||
t._show()
|
||||
}
|
||||
}).on("mouseleave." + t.namespace, function() {
|
||||
if (!f() || t.options.touchDevices) {
|
||||
t.mouseIsOverProxy = false
|
||||
}
|
||||
});
|
||||
if (u && t.options.touchDevices) {
|
||||
t.$elProxy.on("touchstart." + t.namespace, function() {
|
||||
t._showNow()
|
||||
})
|
||||
}
|
||||
} else if (t.options.trigger == "click") {
|
||||
t.$elProxy.on("click." + t.namespace, function() {
|
||||
if (!f() || t.options.touchDevices) {
|
||||
t._show()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// t._responsive();
|
||||
},
|
||||
_responsive: function(){
|
||||
|
||||
/**
|
||||
* init variables
|
||||
*/
|
||||
var large_screen = '',
|
||||
desktop = '',
|
||||
tablet = '',
|
||||
tablet_portrait = '',
|
||||
mobile_landscape = '',
|
||||
mobile = '';
|
||||
|
||||
/**
|
||||
* generate responsive @media css
|
||||
*------------------------------------------------------------*/
|
||||
jQuery(".ult-responsive").each(function(index, element) {
|
||||
|
||||
var t = jQuery(element),
|
||||
n = t.attr('data-responsive-json-new'),
|
||||
target = t.data('ultimate-target'),
|
||||
temp_large_screen = '',
|
||||
temp_desktop = '',
|
||||
temp_tablet = '',
|
||||
temp_tablet_portrait = '',
|
||||
temp_mobile_landscape = '',
|
||||
temp_mobile = '';
|
||||
|
||||
|
||||
// jUST FOR TESTING
|
||||
// CHECK FOR TOOLTIP ONLY
|
||||
if( jQuery(element).hasClass('ult-tooltipster-content') ) {
|
||||
// console.log('n : ' + JSON.stringify(n) );
|
||||
// console.log('target : ' + target );
|
||||
}
|
||||
|
||||
if (typeof n != "undefined" || n != null) {
|
||||
jQuery.each(jQuery.parseJSON(n), function (i, v) {
|
||||
// set css property
|
||||
var css_prop = i;
|
||||
if (typeof v != "undefined" && v != null) {
|
||||
var vals = v.split(";");
|
||||
jQuery.each(vals, function(i, vl) {
|
||||
if (typeof vl != "undefined" || vl != null) {
|
||||
var splitval = vl.split(":");
|
||||
switch(splitval[0]) {
|
||||
case 'large_screen': temp_large_screen += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'desktop': temp_desktop += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'tablet': temp_tablet += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'tablet_portrait': temp_tablet_portrait += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'mobile_landscape':temp_mobile_landscape += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'mobile': temp_mobile += css_prop+":"+splitval[1]+";"; break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* REMOVE Comments for TESTING
|
||||
*-------------------------------------------*/
|
||||
//if(temp_mobile!='') { mobile += '\n\t'+ target+ " { \t\t"+temp_mobile+" \t}"; }
|
||||
//if(temp_mobile_landscape!='') { mobile_landscape += '\n\t'+ target+ " { \t\t"+temp_mobile_landscape+" \t}"; }
|
||||
//if(temp_tablet_portrait!='') { tablet_portrait += '\n\t'+ target+ " { \t\t"+temp_tablet_portrait+" \t}"; }
|
||||
//if(temp_tablet!='') { tablet += '\n\t'+ target+ " { \t\t"+temp_tablet+" \t}"; }
|
||||
//if(temp_desktop!='') { desktop += '\n\t'+ target+ " { \t\t"+temp_desktop+" \t}"; }
|
||||
//if(temp_large_screen!='') { large_screen += '\n\t'+ target+ " { \t\t"+temp_large_screen+" \t}"; }
|
||||
|
||||
if(temp_mobile!='') { mobile += target+ '{'+temp_mobile+'}'; }
|
||||
if(temp_mobile_landscape!='') { mobile_landscape += target+ '{'+temp_mobile_landscape+'}'; }
|
||||
if(temp_tablet_portrait!='') { tablet_portrait += target+ '{'+temp_tablet_portrait+'}'; }
|
||||
if(temp_tablet!='') { tablet += target+ '{'+temp_tablet+'}'; }
|
||||
if(temp_desktop!='') { desktop += target+ '{'+temp_desktop+'}'; }
|
||||
if(temp_large_screen!='') { large_screen += target+ '{'+temp_large_screen+'}'; }
|
||||
});
|
||||
|
||||
/*
|
||||
* REMOVE Comments for TESTING
|
||||
*-------------------------------------------*/
|
||||
var UltimateMedia = '<style>\n/** Ultimate: Tooltipster Responsive **/ ';
|
||||
UltimateMedia += desktop;
|
||||
UltimateMedia += "\n@media (min-width: 1824px) { "+ large_screen +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 1199px) { "+ tablet +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 991px) { "+ tablet_portrait +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 767px) { "+ mobile_landscape +"\n}";
|
||||
UltimateMedia += "\n@media (max-width: 479px) { "+ mobile +"\n}";
|
||||
UltimateMedia += '\n/** Ultimate: Tooltipster Responsive - **/</style>';
|
||||
jQuery('head').append(UltimateMedia);
|
||||
//console.log(UltimateMedia);
|
||||
|
||||
// var UltimateMedia = '<style>/** Ultimate: Tooltipster Responsive **/ ';
|
||||
// UltimateMedia += desktop;
|
||||
// /*UltimateMedia += "@media (min-width: 1824px) { "+ large_screen +"}";*/
|
||||
// UltimateMedia += "@media (max-width: 1199px) { "+ tablet +"}";
|
||||
// UltimateMedia += "@media (max-width: 991px) { "+ tablet_portrait +"}";
|
||||
// UltimateMedia += "@media (max-width: 767px) { "+ mobile_landscape +"}";
|
||||
// UltimateMedia += "@media (max-width: 479px) { "+ mobile +"}";
|
||||
// UltimateMedia += '/** Ultimate: Tooltipster Responsive - **/</style>';
|
||||
// jQuery('head').append(UltimateMedia);
|
||||
// //console.log(UltimateMedia);
|
||||
},
|
||||
_show: function() {
|
||||
var e = this;
|
||||
if (e.Status != "shown" && e.Status != "appearing") {
|
||||
if (e.options.delay) {
|
||||
e.timerShow = setTimeout(function() {
|
||||
if (e.options.trigger == "click" || e.options.trigger == "hover" && e.mouseIsOverProxy) {
|
||||
e._showNow()
|
||||
e._responsive()
|
||||
}
|
||||
}, e.options.delay)
|
||||
} else e._showNow()
|
||||
}
|
||||
e._responsive()
|
||||
},
|
||||
_showNow: function(n) {
|
||||
var r = this;
|
||||
r.options.functionBefore.call(r.$el, r.$el, function() {
|
||||
if (r.enabled && r.Content !== null) {
|
||||
if (n) r.callbacks.show.push(n);
|
||||
r.callbacks.hide = [];
|
||||
clearTimeout(r.timerShow);
|
||||
r.timerShow = null;
|
||||
clearTimeout(r.timerHide);
|
||||
r.timerHide = null;
|
||||
if (r.options.onlyOne) {
|
||||
e(".ult-tooltipstered").not(r.$el).each(function(t, n) {
|
||||
var r = e(n),
|
||||
i = r.data("ult-tooltipster-ns");
|
||||
e.each(i, function(e, t) {
|
||||
var n = r.data(t),
|
||||
i = n.status(),
|
||||
s = n.option("autoClose");
|
||||
if (i !== "hidden" && i !== "disappearing" && s) {
|
||||
n.hide()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
var i = function() {
|
||||
r.Status = "shown";
|
||||
e.each(r.callbacks.show, function(e, t) {
|
||||
t.call(r.$el)
|
||||
});
|
||||
r.callbacks.show = []
|
||||
};
|
||||
if (r.Status !== "hidden") {
|
||||
var s = 0;
|
||||
if (r.Status === "disappearing") {
|
||||
r.Status = "appearing";
|
||||
if (l()) {
|
||||
r.$tooltip.clearQueue().removeClass("ult-tooltipster-dying").addClass("ult-tooltipster-" + r.options.animation + "-show");
|
||||
if (r.options.speed > 0) r.$tooltip.delay(r.options.speed);
|
||||
r.$tooltip.queue(i)
|
||||
} else {
|
||||
r.$tooltip.stop().fadeIn(i)
|
||||
}
|
||||
} else if (r.Status === "shown") {
|
||||
i()
|
||||
}
|
||||
} else {
|
||||
r.Status = "appearing";
|
||||
var s = r.options.speed;
|
||||
|
||||
var contentStyle = BaseStyle = '';
|
||||
if(r.options.ultCustomTooltipStyle) {
|
||||
contentStyle = r.options.ultContentStyle ? r.options.ultContentStyle : "";
|
||||
BaseStyle = r.options.ultBaseStyle ? r.options.ultBaseStyle : "";
|
||||
}
|
||||
|
||||
/*var ultSize = "width: "+ r.options.ultContentSize + ";"; /* ultimate */
|
||||
/*var ultCW = "width: "+ r.options.ultContainerWidth + ";"; /* ultimate */
|
||||
|
||||
r.bodyOverflowX = e("body").css("overflow-x");
|
||||
e("body").css("overflow-x", "hidden");
|
||||
var o = "ult-tooltipster-" + r.options.animation,
|
||||
a = "-webkit-transition-duration: " + r.options.speed + "ms; -webkit-animation-duration: " + r.options.speed + "ms; -moz-transition-duration: " + r.options.speed + "ms; -moz-animation-duration: " + r.options.speed + "ms; -o-transition-duration: " + r.options.speed + "ms; -o-animation-duration: " + r.options.speed + "ms; -ms-transition-duration: " + r.options.speed + "ms; -ms-animation-duration: " + r.options.speed + "ms; transition-duration: " + r.options.speed + "ms; animation-duration: " + r.options.speed + "ms;",
|
||||
f = r.options.minWidth ? "min-width:" + Math.round(r.options.minWidth) + "px;" : "",
|
||||
c = r.options.maxWidth ? "max-width:" + Math.round(r.options.maxWidth) + "px;" : "",
|
||||
h = r.options.interactive ? "pointer-events: auto;" : "";
|
||||
BaseStyle = BaseStyle + ' ' +f+ ' ' +c+' ' +h+' ' +a;
|
||||
|
||||
r.$tooltip = e('<div id="'+r.options.ult_adv_id+'" class="ult-tooltipster-base ' + r.options.theme + '" style="'+BaseStyle+'"><div class="ult-tooltipster-content ult-responsive" data-ultimate-target="'+r.options.ultimate_target+'" data-responsive-json-new = \''+r.options.responsive_json_new+'\' style="'+contentStyle+'"></div></div>');
|
||||
/*r.$tooltip = e('<div class="ult-tooltipster-base ' + r.options.theme + '" style="' + ultCW + " " + f + " " + c + " " + h + " " + a + '"><div class="ult-tooltipster-content" style="'+ultSize+'"></div></div>');*/
|
||||
if (l()) r.$tooltip.addClass(o);
|
||||
r._content_insert();
|
||||
r.$tooltip.appendTo("body");
|
||||
r.reposition();
|
||||
r.options.functionReady.call(r.$el, r.$el, r.$tooltip);
|
||||
if (l()) {
|
||||
r.$tooltip.addClass(o + "-show");
|
||||
if (r.options.speed > 0) r.$tooltip.delay(r.options.speed);
|
||||
r.$tooltip.queue(i)
|
||||
} else {
|
||||
r.$tooltip.css("display", "none").fadeIn(r.options.speed, i)
|
||||
}
|
||||
r._interval_set();
|
||||
e(t).on("scroll." + r.namespace + " resize." + r.namespace, function() {
|
||||
r.reposition()
|
||||
});
|
||||
if (r.options.autoClose) {
|
||||
e("body").off("." + r.namespace);
|
||||
if (r.options.trigger == "hover") {
|
||||
if (u) {
|
||||
setTimeout(function() {
|
||||
e("body").on("touchstart." + r.namespace, function() {
|
||||
r.hide()
|
||||
})
|
||||
}, 0)
|
||||
}
|
||||
if (r.options.interactive) {
|
||||
if (u) {
|
||||
r.$tooltip.on("touchstart." + r.namespace, function(e) {
|
||||
e.stopPropagation()
|
||||
})
|
||||
}
|
||||
var p = null;
|
||||
r.$elProxy.add(r.$tooltip).on("mouseleave." + r.namespace + "-autoClose", function() {
|
||||
clearTimeout(p);
|
||||
p = setTimeout(function() {
|
||||
r.hide()
|
||||
}, r.options.interactiveTolerance)
|
||||
}).on("mouseenter." + r.namespace + "-autoClose", function() {
|
||||
clearTimeout(p)
|
||||
})
|
||||
} else {
|
||||
r.$elProxy.on("mouseleave." + r.namespace + "-autoClose", function() {
|
||||
r.hide()
|
||||
})
|
||||
}
|
||||
} else if (r.options.trigger == "click") {
|
||||
setTimeout(function() {
|
||||
e("body").on("click." + r.namespace + " touchstart." + r.namespace, function() {
|
||||
r.hide()
|
||||
})
|
||||
}, 0);
|
||||
if (r.options.interactive) {
|
||||
r.$tooltip.on("click." + r.namespace + " touchstart." + r.namespace, function(e) {
|
||||
e.stopPropagation()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (r.options.timer > 0) {
|
||||
r.timerHide = setTimeout(function() {
|
||||
r.timerHide = null;
|
||||
r.hide()
|
||||
}, r.options.timer + s)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
_interval_set: function() {
|
||||
var t = this;
|
||||
t.checkInterval = setInterval(function() {
|
||||
if (e("body").find(t.$el).length === 0 || e("body").find(t.$elProxy).length === 0 || t.Status == "hidden" || e("body").find(t.$tooltip).length === 0) {
|
||||
if (t.Status == "shown" || t.Status == "appearing") t.hide();
|
||||
t._interval_cancel()
|
||||
} else {
|
||||
if (t.options.positionTracker) {
|
||||
var n = t._repositionInfo(t.$elProxy),
|
||||
r = false;
|
||||
if (o(n.dimension, t.elProxyPosition.dimension)) {
|
||||
if (t.$elProxy.css("position") === "fixed") {
|
||||
if (o(n.position, t.elProxyPosition.position)) r = true
|
||||
} else {
|
||||
if (o(n.offset, t.elProxyPosition.offset)) r = true
|
||||
}
|
||||
}
|
||||
if (!r) {
|
||||
t.reposition()
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 200)
|
||||
},
|
||||
_interval_cancel: function() {
|
||||
clearInterval(this.checkInterval);
|
||||
this.checkInterval = null
|
||||
},
|
||||
_content_set: function(e) {
|
||||
if (typeof e === "object" && e !== null && this.options.contentCloning) {
|
||||
e = e.clone(true)
|
||||
}
|
||||
this.Content = e
|
||||
},
|
||||
_content_insert: function() {
|
||||
var e = this,
|
||||
t = this.$tooltip.find(".ult-tooltipster-content");
|
||||
if (typeof e.Content === "string" && !e.options.contentAsHTML) {
|
||||
t.text(e.Content)
|
||||
} else {
|
||||
t.empty().append(e.Content)
|
||||
}
|
||||
},
|
||||
_update: function(e) {
|
||||
var t = this;
|
||||
t._content_set(e);
|
||||
if (t.Content !== null) {
|
||||
if (t.Status !== "hidden") {
|
||||
t._content_insert();
|
||||
t.reposition();
|
||||
if (t.options.updateAnimation) {
|
||||
if (l()) {
|
||||
t.$tooltip.css({
|
||||
width: "",
|
||||
"-webkit-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
|
||||
"-moz-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
|
||||
"-o-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
|
||||
"-ms-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
|
||||
transition: "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms"
|
||||
}).addClass("ult-tooltipster-content-changing");
|
||||
setTimeout(function() {
|
||||
if (t.Status != "hidden") {
|
||||
t.$tooltip.removeClass("ult-tooltipster-content-changing");
|
||||
setTimeout(function() {
|
||||
if (t.Status !== "hidden") {
|
||||
t.$tooltip.css({
|
||||
"-webkit-transition": t.options.speed + "ms",
|
||||
"-moz-transition": t.options.speed + "ms",
|
||||
"-o-transition": t.options.speed + "ms",
|
||||
"-ms-transition": t.options.speed + "ms",
|
||||
transition: t.options.speed + "ms"
|
||||
})
|
||||
}
|
||||
}, t.options.speed)
|
||||
}
|
||||
}, t.options.speed)
|
||||
} else {
|
||||
t.$tooltip.fadeTo(t.options.speed, .5, function() {
|
||||
if (t.Status != "hidden") {
|
||||
t.$tooltip.fadeTo(t.options.speed, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
t.hide()
|
||||
}
|
||||
},
|
||||
_repositionInfo: function(e) {
|
||||
return {
|
||||
dimension: {
|
||||
height: e.outerHeight(false),
|
||||
width: e.outerWidth(false)
|
||||
},
|
||||
offset: e.offset(),
|
||||
position: {
|
||||
left: parseInt(e.css("left")),
|
||||
top: parseInt(e.css("top"))
|
||||
}
|
||||
}
|
||||
},
|
||||
hide: function(n) {
|
||||
var r = this;
|
||||
if (n) r.callbacks.hide.push(n);
|
||||
r.callbacks.show = [];
|
||||
clearTimeout(r.timerShow);
|
||||
r.timerShow = null;
|
||||
clearTimeout(r.timerHide);
|
||||
r.timerHide = null;
|
||||
var i = function() {
|
||||
e.each(r.callbacks.hide, function(e, t) {
|
||||
t.call(r.$el)
|
||||
});
|
||||
r.callbacks.hide = []
|
||||
};
|
||||
if (r.Status == "shown" || r.Status == "appearing") {
|
||||
r.Status = "disappearing";
|
||||
var s = function() {
|
||||
r.Status = "hidden";
|
||||
if (typeof r.Content == "object" && r.Content !== null) {
|
||||
r.Content.detach()
|
||||
}
|
||||
r.$tooltip.remove();
|
||||
r.$tooltip = null;
|
||||
e(t).off("." + r.namespace);
|
||||
e("body").off("." + r.namespace).css("overflow-x", r.bodyOverflowX);
|
||||
e("body").off("." + r.namespace);
|
||||
r.$elProxy.off("." + r.namespace + "-autoClose");
|
||||
r.options.functionAfter.call(r.$el, r.$el);
|
||||
i()
|
||||
};
|
||||
if (l()) {
|
||||
r.$tooltip.clearQueue().removeClass("ult-tooltipster-" + r.options.animation + "-show").addClass("ult-tooltipster-dying");
|
||||
if (r.options.speed > 0) r.$tooltip.delay(r.options.speed);
|
||||
r.$tooltip.queue(s)
|
||||
} else {
|
||||
r.$tooltip.stop().fadeOut(r.options.speed, s)
|
||||
}
|
||||
} else if (r.Status == "hidden") {
|
||||
i()
|
||||
}
|
||||
return r
|
||||
},
|
||||
show: function(e) {
|
||||
this._showNow(e);
|
||||
return this
|
||||
},
|
||||
update: function(e) {
|
||||
return this.content(e)
|
||||
},
|
||||
content: function(e) {
|
||||
if (typeof e === "undefined") {
|
||||
return this.Content
|
||||
} else {
|
||||
this._update(e);
|
||||
return this
|
||||
}
|
||||
},
|
||||
reposition: function() {
|
||||
var n = this;
|
||||
if (e("body").find(n.$tooltip).length !== 0) {
|
||||
n.$tooltip.css("width", "");
|
||||
n.elProxyPosition = n._repositionInfo(n.$elProxy);
|
||||
var r = null,
|
||||
i = e(t).width(),
|
||||
s = n.elProxyPosition,
|
||||
o = n.$tooltip.outerWidth(false),
|
||||
u = n.$tooltip.innerWidth() + 1,
|
||||
a = n.$tooltip.outerHeight(false);
|
||||
if (n.$elProxy.is("area")) {
|
||||
var f = n.$elProxy.attr("shape"),
|
||||
l = n.$elProxy.parent().attr("name"),
|
||||
c = e('img[usemap="#' + l + '"]'),
|
||||
h = c.offset().left,
|
||||
p = c.offset().top,
|
||||
d = n.$elProxy.attr("coords") !== undefined ? n.$elProxy.attr("coords").split(",") : undefined;
|
||||
if (f == "circle") {
|
||||
var v = parseInt(d[0]),
|
||||
m = parseInt(d[1]),
|
||||
g = parseInt(d[2]);
|
||||
s.dimension.height = g * 2;
|
||||
s.dimension.width = g * 2;
|
||||
s.offset.top = p + m - g;
|
||||
s.offset.left = h + v - g
|
||||
} else if (f == "rect") {
|
||||
var v = parseInt(d[0]),
|
||||
m = parseInt(d[1]),
|
||||
y = parseInt(d[2]),
|
||||
b = parseInt(d[3]);
|
||||
s.dimension.height = b - m;
|
||||
s.dimension.width = y - v;
|
||||
s.offset.top = p + m;
|
||||
s.offset.left = h + v
|
||||
} else if (f == "poly") {
|
||||
var w = [],
|
||||
E = [],
|
||||
S = 0,
|
||||
x = 0,
|
||||
T = 0,
|
||||
N = 0,
|
||||
C = "even";
|
||||
for (var k = 0; k < d.length; k++) {
|
||||
var L = parseInt(d[k]);
|
||||
if (C == "even") {
|
||||
if (L > T) {
|
||||
T = L;
|
||||
if (k === 0) {
|
||||
S = T
|
||||
}
|
||||
}
|
||||
if (L < S) {
|
||||
S = L
|
||||
}
|
||||
C = "odd"
|
||||
} else {
|
||||
if (L > N) {
|
||||
N = L;
|
||||
if (k == 1) {
|
||||
x = N
|
||||
}
|
||||
}
|
||||
if (L < x) {
|
||||
x = L
|
||||
}
|
||||
C = "even"
|
||||
}
|
||||
}
|
||||
s.dimension.height = N - x;
|
||||
s.dimension.width = T - S;
|
||||
s.offset.top = p + x;
|
||||
s.offset.left = h + S
|
||||
} else {
|
||||
s.dimension.height = c.outerHeight(false);
|
||||
s.dimension.width = c.outerWidth(false);
|
||||
s.offset.top = p;
|
||||
s.offset.left = h
|
||||
}
|
||||
}
|
||||
var A = 0,
|
||||
O = 0,
|
||||
M = 0,
|
||||
_ = parseInt(n.options.offsetY),
|
||||
D = parseInt(n.options.offsetX),
|
||||
P = n.options.position;
|
||||
|
||||
function H() {
|
||||
var n = e(t).scrollLeft();
|
||||
if (A - n < 0) {
|
||||
r = A - n;
|
||||
A = n
|
||||
}
|
||||
if (A + o - n > i) {
|
||||
r = A - (i + n - o);
|
||||
A = i + n - o
|
||||
}
|
||||
}
|
||||
|
||||
function B(n, r) {
|
||||
if (s.offset.top - e(t).scrollTop() - a - _ - 12 < 0 && r.indexOf("top") > -1) {
|
||||
P = n
|
||||
}
|
||||
if (s.offset.top + s.dimension.height + a + 12 + _ > e(t).scrollTop() + e(t).height() && r.indexOf("bottom") > -1) {
|
||||
P = n;
|
||||
M = s.offset.top - a - _ - 12
|
||||
}
|
||||
}
|
||||
if (P == "top") {
|
||||
var j = s.offset.left + o - (s.offset.left + s.dimension.width);
|
||||
A = s.offset.left + D - j / 2;
|
||||
M = s.offset.top - a - _ - 12;
|
||||
|
||||
/*
|
||||
* Calculate tooltip border width:
|
||||
*------------------------------------------------*/
|
||||
/*var blw = parseInt(n.$tooltip.css("border-left-width"), 10),
|
||||
brw = parseInt(n.$tooltip.css("border-right-width"), 10);
|
||||
var remb = blw + brw;
|
||||
A = A - remb ;*/
|
||||
//alert(o);
|
||||
//25 + 25 + 375 = 425;
|
||||
|
||||
H();
|
||||
B("bottom", "top")
|
||||
}
|
||||
if (P == "top-left") {
|
||||
A = s.offset.left + D;
|
||||
M = s.offset.top - a - _ - 12;
|
||||
H();
|
||||
B("bottom-left", "top-left")
|
||||
}
|
||||
if (P == "top-right") {
|
||||
A = s.offset.left + s.dimension.width + D - o;
|
||||
M = s.offset.top - a - _ - 12;
|
||||
H();
|
||||
B("bottom-right", "top-right")
|
||||
}
|
||||
if (P == "bottom") {
|
||||
var j = s.offset.left + o - (s.offset.left + s.dimension.width);
|
||||
A = s.offset.left - j / 2 + D;
|
||||
M = s.offset.top + s.dimension.height + _ + 12;
|
||||
|
||||
/*
|
||||
* Calculate tooltip border width: for [BOTTOM]
|
||||
*------------------------------------------------*/
|
||||
/*var blw = parseInt(n.$tooltip.css("border-left-width"), 10),
|
||||
brw = parseInt(n.$tooltip.css("border-right-width"), 10);
|
||||
var remb = (blw + brw) / 2;
|
||||
A = A - remb ;*/
|
||||
|
||||
H();
|
||||
B("top", "bottom")
|
||||
}
|
||||
if (P == "bottom-left") {
|
||||
A = s.offset.left + D;
|
||||
M = s.offset.top + s.dimension.height + _ + 12;
|
||||
H();
|
||||
B("top-left", "bottom-left")
|
||||
}
|
||||
if (P == "bottom-right") {
|
||||
A = s.offset.left + s.dimension.width + D - o;
|
||||
M = s.offset.top + s.dimension.height + _ + 12;
|
||||
H();
|
||||
B("top-right", "bottom-right")
|
||||
}
|
||||
if (P == "left") {
|
||||
A = s.offset.left - D - o - 12;
|
||||
O = s.offset.left + D + s.dimension.width + 12;
|
||||
var F = s.offset.top + a - (s.offset.top + s.dimension.height);
|
||||
M = s.offset.top - F / 2 - _;
|
||||
|
||||
/*
|
||||
* Calculate tooltip border width: for [BOTTOM]
|
||||
*------------------------------------------------*/
|
||||
/*var btw = parseInt(n.$tooltip.css("border-top-width"), 10),
|
||||
bbw = parseInt(n.$tooltip.css("border-bottom-width"), 10);
|
||||
var ptb = (btw + bbw) / 2;
|
||||
M = M - ptb ;*/
|
||||
//alert(M);
|
||||
|
||||
if (A < 0 && O + o > i) {
|
||||
var I = parseFloat(n.$tooltip.css("border-width")) * 2,
|
||||
q = o + A - I;
|
||||
n.$tooltip.css("width", q + "px");
|
||||
a = n.$tooltip.outerHeight(false);
|
||||
A = s.offset.left - D - q - 12 - I;
|
||||
F = s.offset.top + a - (s.offset.top + s.dimension.height);
|
||||
M = s.offset.top - F / 2 - _
|
||||
} else if (A < 0) {
|
||||
A = s.offset.left + D + s.dimension.width + 12;
|
||||
r = "left"
|
||||
}
|
||||
}
|
||||
if (P == "right") {
|
||||
A = s.offset.left + D + s.dimension.width + 12;
|
||||
O = s.offset.left - D - o - 12;
|
||||
var F = s.offset.top + a - (s.offset.top + s.dimension.height);
|
||||
M = s.offset.top - F / 2 - _;
|
||||
|
||||
/*
|
||||
* Calculate tooltip border width: for [BOTTOM]
|
||||
*------------------------------------------------*/
|
||||
/* var btw = parseInt(n.$tooltip.css("border-top-width"), 10),
|
||||
bbw = parseInt(n.$tooltip.css("border-bottom-width"), 10);
|
||||
var ptb = (btw + bbw) / 2;
|
||||
M = M + ptb ;*/
|
||||
|
||||
|
||||
if (A + o > i && O < 0) {
|
||||
var I = parseFloat(n.$tooltip.css("border-width")) * 2,
|
||||
q = i - A - I;
|
||||
n.$tooltip.css("width", q + "px");
|
||||
a = n.$tooltip.outerHeight(false);
|
||||
F = s.offset.top + a - (s.offset.top + s.dimension.height);
|
||||
M = s.offset.top - F / 2 - _
|
||||
} else if (A + o > i) {
|
||||
A = s.offset.left - D - o - 12;
|
||||
r = "right"
|
||||
}
|
||||
}
|
||||
if (n.options.arrow) {
|
||||
var R = "ult-tooltipster-arrow-" + P;
|
||||
if (n.options.arrowColor.length < 1) {
|
||||
var U = n.$tooltip.css("background-color")
|
||||
} else {
|
||||
var U = n.options.arrowColor
|
||||
}
|
||||
if (!r) {
|
||||
r = ""
|
||||
} else if (r == "left") {
|
||||
R = "ult-tooltipster-arrow-right";
|
||||
r = ""
|
||||
} else if (r == "right") {
|
||||
R = "ult-tooltipster-arrow-left";
|
||||
r = ""
|
||||
} else {
|
||||
r = "left:" + Math.round(r) + "px;"
|
||||
}
|
||||
if (P == "top" || P == "top-left" || P == "top-right") {
|
||||
var z = parseFloat(n.$tooltip.css("border-bottom-width")),
|
||||
W = n.$tooltip.css("border-bottom-color");
|
||||
} else if (P == "bottom" || P == "bottom-left" || P == "bottom-right") {
|
||||
var z = parseFloat(n.$tooltip.css("border-top-width")),
|
||||
W = n.$tooltip.css("border-top-color")
|
||||
} else if (P == "left") {
|
||||
var z = parseFloat(n.$tooltip.css("border-right-width")),
|
||||
W = n.$tooltip.css("border-right-color")
|
||||
} else if (P == "right") {
|
||||
var z = parseFloat(n.$tooltip.css("border-left-width")),
|
||||
W = n.$tooltip.css("border-left-color")
|
||||
} else {
|
||||
var z = parseFloat(n.$tooltip.css("border-bottom-width")),
|
||||
W = n.$tooltip.css("border-bottom-color")
|
||||
}
|
||||
if (z > 1) {
|
||||
z++
|
||||
}
|
||||
var X = "";
|
||||
if (z !== 0) {
|
||||
var V = "",
|
||||
J = "border-color: " + W + ";";
|
||||
if (R.indexOf("bottom") !== -1) {
|
||||
V = "margin-top: -" + Math.round(z) + "px;"
|
||||
} else if (R.indexOf("top") !== -1) {
|
||||
V = "margin-bottom: -" + Math.round(z) + "px;"
|
||||
} else if (R.indexOf("left") !== -1) {
|
||||
V = "margin-right: -" + Math.round(z) + "px;"
|
||||
} else if (R.indexOf("right") !== -1) {
|
||||
V = "margin-left: -" + Math.round(z) + "px;"
|
||||
}
|
||||
X = '<span class="ult-tooltipster-arrow-border" style="' + V + " " + J + ';"></span>'
|
||||
}
|
||||
n.$tooltip.find(".ult-tooltipster-arrow").remove();
|
||||
var K = '<div class="' + R + ' ult-tooltipster-arrow" style="' + r + '">' + X + '<span style="border-color:' + U + ';" ></span></div>';
|
||||
n.$tooltip.append(K)
|
||||
}
|
||||
|
||||
n.$tooltip.css({
|
||||
top: Math.round(M) + "px",
|
||||
left: Math.round(A) + "px"
|
||||
})
|
||||
}
|
||||
return n
|
||||
},
|
||||
enable: function() {
|
||||
this.enabled = true;
|
||||
return this
|
||||
},
|
||||
disable: function() {
|
||||
this.hide();
|
||||
this.enabled = false;
|
||||
return this
|
||||
},
|
||||
destroy: function() {
|
||||
var t = this;
|
||||
t.hide();
|
||||
if (t.$el[0] !== t.$elProxy[0]) t.$elProxy.remove();
|
||||
t.$el.removeData(t.namespace).off("." + t.namespace);
|
||||
var n = t.$el.data("ult-tooltipster-ns");
|
||||
if (n.length === 1) {
|
||||
var r = typeof t.Content === "string" ? t.Content : e("<div></div>").append(t.Content).html();
|
||||
t.$el.removeClass("ult-tooltipstered").attr("title", r).removeData(t.namespace).removeData("ult-tooltipster-ns").off("." + t.namespace)
|
||||
} else {
|
||||
n = e.grep(n, function(e, n) {
|
||||
return e !== t.namespace
|
||||
});
|
||||
t.$el.data("ult-tooltipster-ns", n)
|
||||
}
|
||||
return t
|
||||
},
|
||||
elementIcon: function() {
|
||||
return this.$el[0] !== this.$elProxy[0] ? this.$elProxy[0] : undefined
|
||||
},
|
||||
elementTooltip: function() {
|
||||
return this.$tooltip ? this.$tooltip[0] : undefined
|
||||
},
|
||||
option: function(e, t) {
|
||||
if (typeof t == "undefined") return this.options[e];
|
||||
else {
|
||||
this.options[e] = t;
|
||||
return this
|
||||
}
|
||||
},
|
||||
status: function() {
|
||||
return this.Status
|
||||
}
|
||||
};
|
||||
e.fn[r] = function() {
|
||||
var t = arguments;
|
||||
if (this.length === 0) {
|
||||
if (typeof t[0] === "string") {
|
||||
var n = true;
|
||||
switch (t[0]) {
|
||||
case "setDefaults":
|
||||
e.extend(i, t[1]);
|
||||
break;
|
||||
default:
|
||||
n = false;
|
||||
break
|
||||
}
|
||||
if (n) return true;
|
||||
else return this
|
||||
} else {
|
||||
return this
|
||||
}
|
||||
} else {
|
||||
if (typeof t[0] === "string") {
|
||||
var r = "#*$~&";
|
||||
this.each(function() {
|
||||
var n = e(this).data("ult-tooltipster-ns"),
|
||||
i = n ? e(this).data(n[0]) : null;
|
||||
if (i) {
|
||||
if (typeof i[t[0]] === "function") {
|
||||
var s = i[t[0]](t[1], t[2])
|
||||
} else {
|
||||
throw new Error('Unknown method .ult-tooltipster("' + t[0] + '")')
|
||||
}
|
||||
if (s !== i) {
|
||||
r = s;
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
throw new Error("You called Tooltipster's \"" + t[0] + '" method on an uninitialized element')
|
||||
}
|
||||
});
|
||||
return r !== "#*$~&" ? r : this
|
||||
} else {
|
||||
var o = [],
|
||||
u = t[0] && typeof t[0].multiple !== "undefined",
|
||||
a = u && t[0].multiple || !u && i.multiple,
|
||||
f = t[0] && typeof t[0].debug !== "undefined",
|
||||
l = f && t[0].debug || !f && i.debug;
|
||||
this.each(function() {
|
||||
var n = false,
|
||||
r = e(this).data("ult-tooltipster-ns"),
|
||||
i = null;
|
||||
if (!r) {
|
||||
n = true
|
||||
} else if (a) {
|
||||
n = true
|
||||
} else if (l) {
|
||||
console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')
|
||||
}
|
||||
if (n) {
|
||||
i = new s(this, t[0]);
|
||||
if (!r) r = [];
|
||||
r.push(i.namespace);
|
||||
e(this).data("ult-tooltipster-ns", r);
|
||||
e(this).data(i.namespace, i)
|
||||
}
|
||||
o.push(i)
|
||||
});
|
||||
if (a) return o;
|
||||
else return this
|
||||
}
|
||||
}
|
||||
};
|
||||
var u = !!("ontouchstart" in t);
|
||||
var a = false;
|
||||
e("body").one("mousemove", function() {
|
||||
a = true
|
||||
})
|
||||
})(jQuery, window, document);
|
||||
@@ -0,0 +1,150 @@
|
||||
;(function ( $, window, undefined ) {
|
||||
|
||||
$(document).ready(function(a) {
|
||||
|
||||
init_tooltip();
|
||||
setTimeout(function() {
|
||||
$(window).load(function(){
|
||||
if($('.ult_hotspot_container').length > 0) {
|
||||
var status = $('.ult_hotspot_container').find('.ult-hotspot-tooltip').attr('data-status') || 'hide';
|
||||
if( status === 'show' ) {
|
||||
$(".ult-tooltipstered").ulttooltipster('destroy');
|
||||
}
|
||||
init_tooltip();
|
||||
}
|
||||
});
|
||||
}, 700);
|
||||
|
||||
$(document).ajaxComplete(function(e, xhr, settings){
|
||||
init_tooltip();
|
||||
});
|
||||
|
||||
function init_tooltip()
|
||||
{
|
||||
var parama1 = "", parama2 = "";
|
||||
$('a[href="#"]').click(function(event){
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
a(".ult_hotspot_container.ult-hotspot-tooltip-wrapper").each(function() {
|
||||
a(this);
|
||||
|
||||
/*var f = a(this).data("width") || 320,*/
|
||||
var g = a(this).data("opacity") || .5;
|
||||
|
||||
|
||||
a(".ult-hotspot-tooltip[data-link_style='tootip']", a(this)).each(function() {
|
||||
|
||||
if($(this).find('.aio-icon-img').length > 0)
|
||||
{
|
||||
var iconHeight = $(this).find('.aio-icon-img').outerHeight( true );
|
||||
var iconWidth = $(this).find('.aio-icon-img').outerWidth( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
var iconHeight = jQuery(this).find('.aio-icon').outerHeight( true );
|
||||
var iconWidth = jQuery(this).find('.aio-icon').outerWidth( true );
|
||||
}
|
||||
|
||||
var y = Math.round(iconHeight / 2);
|
||||
var x = Math.round(iconWidth / 2);
|
||||
|
||||
var h, d = a(this).data("tooltipanimation"),
|
||||
e = a(this).data("trigger") || "hover";
|
||||
|
||||
var j = a(this).data("arrowposition") || "top";
|
||||
|
||||
var ba = a(this).data("bubble-arrow");
|
||||
|
||||
var ContentStyle = a(this).data("tooltip-content-style");// || false;
|
||||
var BaseStyle = a(this).data("tooltip-base-style");// || false;
|
||||
|
||||
var k = a(this).find(".hotspot-tooltip-content").html(),
|
||||
l = 3,
|
||||
m = a(this).data("tooltip-offsety") || 0;
|
||||
|
||||
k = a(this).find(".hotspot-tooltip-content").html(k).text();
|
||||
|
||||
var custid = a(this).data("mycust-id");
|
||||
|
||||
parama1 =a(this).data("ultimate-target");
|
||||
parama2 =a(this).data("responsive-json-new");
|
||||
parama2 = JSON.stringify(parama2);
|
||||
|
||||
if(j == 'top')
|
||||
{
|
||||
y = 0;
|
||||
}
|
||||
if(j == 'bottom')
|
||||
{
|
||||
y = iconHeight;
|
||||
}
|
||||
if(j == 'left')
|
||||
{
|
||||
y = -y;
|
||||
x = 0;
|
||||
}
|
||||
if(j == 'right')
|
||||
{
|
||||
x = iconWidth;
|
||||
y = -y;
|
||||
}
|
||||
|
||||
if(/firefox/.test(navigator.userAgent.toLowerCase()))
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
a(this).ulttooltipster({
|
||||
content: k,
|
||||
position: j,
|
||||
offsetX: x, //l,
|
||||
offsetY: y,//0, //m,
|
||||
|
||||
/* Ultimate Options
|
||||
*---------------------------*/
|
||||
ultCustomTooltipStyle: true,
|
||||
ultContentStyle: ContentStyle,
|
||||
ultBaseStyle: BaseStyle,
|
||||
//ultContainerWidth: r,
|
||||
//ultBaseWidth: f,
|
||||
//ultPadding: pd,
|
||||
|
||||
//ultBaseBGColor: cbgc,//"rgb(8, 187, 252)",
|
||||
//ultBaseBorderColor: cbc,//"rgb(8, 187, 252)",
|
||||
|
||||
//ultBaseColor: cc,
|
||||
|
||||
//maxWidth: 300,
|
||||
arrow: ba,
|
||||
|
||||
// Bubble arrow
|
||||
//arrow: true,
|
||||
//customid: custid,
|
||||
delay: 100,
|
||||
speed: 300,
|
||||
interactive: !0,
|
||||
animation: d,
|
||||
trigger: e,
|
||||
/*positionTracker: true,*/
|
||||
/*contentAsHTML: 1,*/
|
||||
contentAsHTML: 1,
|
||||
//theme: 'tooltipster-default', //"tooltipster-" + c,
|
||||
/*minWidth: r,*/
|
||||
/*ultContainerWidth: f,*/ /* ultimate */
|
||||
/*ultContentSize: r,*/ /* ultimate */
|
||||
|
||||
ult_adv_id: custid,
|
||||
responsive_json_new:parama2,
|
||||
ultimate_target:parama1
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}(jQuery, window));
|
||||
@@ -0,0 +1,57 @@
|
||||
;(function ( $, window, undefined ) {
|
||||
// Hide until page load
|
||||
$( window ).load(function() {
|
||||
$('.ult-ih-container').css({'visibility':'visible', 'opacity':1});
|
||||
});
|
||||
$(document).ready(function () {
|
||||
ult_ihover_init();
|
||||
$(document).ajaxComplete(function(e, xhr, settings){
|
||||
ult_ihover_init();
|
||||
});
|
||||
});
|
||||
$(window).resize(function(){
|
||||
ult_ihover_init();
|
||||
});
|
||||
function responsive_sizes(el, ww, h, w, rh, rw) {
|
||||
if(ww!='') {
|
||||
|
||||
|
||||
if(ww>=768) {
|
||||
if( $(el).find('.ult-ih-item').hasClass('ult-ih-effect20') ) {
|
||||
$(el).find('.spinner').css({'height': parseInt(h),'width': parseInt(w)});
|
||||
}
|
||||
else {
|
||||
$(el).find('.ult-ih-item, .ult-ih-img, .ult-ih-image-block, .ult-ih-list-item').css({'height': h,'width': w});
|
||||
}
|
||||
} else {
|
||||
if( $(el).find('.ult-ih-item').hasClass('ult-ih-effect20') ) {
|
||||
$(el).find('.spinner').css({'height': parseInt(rh),'width': parseInt(rw)});
|
||||
}
|
||||
else {
|
||||
$(el).find('.ult-ih-item, .ult-ih-img, .ult-ih-image-block, .ult-ih-list-item').css({'height': rh,'width': rw});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function ult_ihover_init() {
|
||||
$('.ult-ih-list').each(function(index, el){
|
||||
var s = $(el).attr('data-shape');
|
||||
var h = $(el).attr('data-height');
|
||||
var w = $(el).attr('data-width');
|
||||
var rh = $(el).attr('data-res_height');
|
||||
var rw = $(el).attr('data-res_width');
|
||||
var ww = jQuery(window).width() || '';
|
||||
|
||||
$(el).find('li').each(function(){
|
||||
|
||||
// Shape
|
||||
$(el).find('.ult-ih-item').addClass('ult-ih-' + s);
|
||||
|
||||
// Responsive & Normal
|
||||
responsive_sizes(el, ww, h, w, rh, rw);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}(jQuery, window));
|
||||
@@ -0,0 +1,19 @@
|
||||
// JavaScript Document
|
||||
(function ( $ ) {
|
||||
$(document).ready(function(){
|
||||
$(document).trigger('ultImageSeparator');
|
||||
});
|
||||
$(window).load(function(){
|
||||
$(document).trigger('ultImageSeparator');
|
||||
});
|
||||
$(document).on('ultImageSeparator', function(event){
|
||||
$('.ult-easy-separator-wrapper').each(function(i,wr){
|
||||
var vc_row = $(this).attr('data-vc-row');
|
||||
var $row = $(this).parents('.'+vc_row+':first');
|
||||
if($row.hasClass('upb-background-text')) {
|
||||
$row = $row.parents('.'+vc_row+':first');
|
||||
}
|
||||
$(this).appendTo($row).find('.ult-no-animation').css({'opacity':'1'});
|
||||
});
|
||||
});
|
||||
}( jQuery ));
|
||||
@@ -0,0 +1 @@
|
||||
<?php␍/*Silence is Golden*/
|
||||
@@ -0,0 +1,41 @@
|
||||
(function($) {
|
||||
$(document).ready(function(){
|
||||
align_info();
|
||||
|
||||
$(window).resize(function(){
|
||||
align_info();
|
||||
});
|
||||
|
||||
// CSS3 Transitions.
|
||||
jQuery('.ultb3-box .ultb3-info').each(function(){
|
||||
if(jQuery(this).attr('data-animation')) {
|
||||
jQuery(this).css('opacity','0');
|
||||
var animationName = jQuery(this).attr('data-animation'),
|
||||
animationDelay = "delay-"+jQuery(this).attr('data-animation-delay');
|
||||
jQuery(this).bsf_appear(function() {
|
||||
var $this = jQuery(this);
|
||||
//$this.css('opacity','0');
|
||||
//setTimeout(function(){
|
||||
$this.addClass('animated').addClass(animationName);
|
||||
$this.addClass('animated').addClass(animationDelay);
|
||||
$this.css('opacity','1');
|
||||
//},1000);
|
||||
},{accY: -70});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(window).load(function(){
|
||||
align_info();
|
||||
});
|
||||
|
||||
function align_info()
|
||||
{
|
||||
$('.ultb3-box').each(function(i,ib){
|
||||
var ib_height = $(ib).outerHeight();
|
||||
var ib_info_height = $(ib).find('.ultb3-info').outerHeight();
|
||||
var diff = (ib_height-ib_info_height)/2;
|
||||
$(ib).find('.ultb3-info').css({'top':diff});
|
||||
});
|
||||
}
|
||||
}( jQuery ));
|
||||
@@ -0,0 +1,24 @@
|
||||
jQuery(window).load(function(a){
|
||||
info_box_set_auto_height();
|
||||
});
|
||||
jQuery(document).ready(function(a) {
|
||||
info_box_set_auto_height();
|
||||
jQuery(window).resize(function(a){
|
||||
info_box_set_auto_height();
|
||||
});
|
||||
});
|
||||
function info_box_set_auto_height() {
|
||||
jQuery('.aio-icon-box.square_box-icon').each(function(index, value) {
|
||||
var WW = jQuery(window).width() || '';
|
||||
if(WW!='') {
|
||||
if(WW>=768) {
|
||||
var h = jQuery(this).attr('data-min-height') || '';
|
||||
if(h!='') {
|
||||
jQuery(this).css('min-height', h);
|
||||
}
|
||||
} else {
|
||||
jQuery(this).css('min-height', 'initial');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,532 @@
|
||||
var resizedd=0;
|
||||
var time_f_arr =[];
|
||||
jQuery(document).ready(function(){
|
||||
make_info_circle('.info-c-full-br',0);
|
||||
responsive_check('.info-c-full-br');
|
||||
//calculate_clipped_circle();
|
||||
//make_info_circle('.info-c-semi-br',0);
|
||||
//responsive_check('.info-c-semi-br');
|
||||
//part_circle_icon('.info-c-full-br');
|
||||
//semi_circle_icon('.info-c-semi-br');
|
||||
|
||||
jQuery('.clipped-info-circle').each(function(i,circle){
|
||||
var xh = jQuery(this).outerHeight();
|
||||
var xw = jQuery(this).outerWidth();
|
||||
jQuery(this).attr('data-first-width',xw);
|
||||
jQuery(this).attr('data-first-height',xh);
|
||||
});
|
||||
|
||||
|
||||
jQuery(window).resize(function(){
|
||||
resizedd++;
|
||||
make_info_circle('.info-c-full-br',resizedd);
|
||||
calculate_clipped_circle();
|
||||
//make_info_circle('.info-c-semi-br',resizedd);
|
||||
});
|
||||
jQuery(window).load(function(){
|
||||
resizedd++;
|
||||
make_info_circle('.info-c-full-br',resizedd);
|
||||
calculate_clipped_circle();
|
||||
//make_info_circle('.info-c-semi-br',resizedd);
|
||||
});
|
||||
jQuery(document).on('ultAdvancedTabClicked',function(){
|
||||
resizedd++;
|
||||
make_info_circle('.info-c-full-br',resizedd);
|
||||
calculate_clipped_circle();
|
||||
});
|
||||
jQuery('.info-c-full-br').each(function(){
|
||||
if(jQuery(this).data('focus-on')=="click"){
|
||||
jQuery(this).find('.icon-circle-list .info-circle-icons').click(function(){
|
||||
var obj = jQuery(this);
|
||||
jQuery(this).parents('.info-c-full-br').attr('data-slide-true','false');
|
||||
show_next_info_circle(obj);
|
||||
})
|
||||
}
|
||||
if(jQuery(this).data('focus-on')=="hover"){
|
||||
jQuery(this).find('.icon-circle-list .info-circle-icons').hover(function(){
|
||||
var obj = jQuery(this);
|
||||
jQuery(this).parents('.info-c-full-br').attr('data-slide-true','false');
|
||||
show_next_info_circle(obj);
|
||||
},function(){})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*jQuery('.info-c-semi-br .icon-circle-list .info-circle-icons').bind('click',function(){
|
||||
var txt = jQuery(this).find('.text').html();
|
||||
var highlight_style= jQuery(this).parents('.info-c-full-br').data('highlight-style');
|
||||
if(highlight_style==''){
|
||||
//console.warn("Info Circle Higlight style not defined")
|
||||
}else{
|
||||
jQuery('.'+highlight_style).removeClass(highlight_style).removeClass('info-cirlce-active');
|
||||
jQuery(this).addClass(highlight_style).addClass('info-cirlce-active');
|
||||
}
|
||||
jQuery(this).parents('.info-c-semi-br').find('.info-c-semi').html(txt);
|
||||
})
|
||||
*/
|
||||
//jQuery('.info-c-full-br').attr('data-slide-true','true');
|
||||
setTimeout(function() {
|
||||
jQuery('.info-c-full-br').each(function(){
|
||||
var slide_delay = jQuery(this).data('slide-duration');
|
||||
if(!slide_delay){
|
||||
slide_delay = 0.2;
|
||||
}
|
||||
jQuery(this).attr('data-slide-number','1');
|
||||
info_circle_slide((slide_delay*1000),jQuery(this));
|
||||
//if(jQuery(this).attr('data-slide-true')=='off'){
|
||||
var obj = jQuery(this).find('.info-circle-icons').eq(0);
|
||||
show_next_info_circle(obj);
|
||||
//}
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
function calculate_clipped_circle()
|
||||
{
|
||||
jQuery('.clipped-info-circle').each(function(){
|
||||
var circle_type = jQuery(this).data('circle-type');
|
||||
var percentage = jQuery(this).data('half-percentage');
|
||||
|
||||
var responsive = jQuery(this).children().data('responsive-circle');
|
||||
if(responsive == 'on')
|
||||
{
|
||||
var breakpoint = jQuery(this).children().data('responsive-breakpoint');
|
||||
var win = jQuery(window).width();
|
||||
var circle_type = jQuery(this).data('circle-type');
|
||||
if(win > breakpoint)
|
||||
{
|
||||
var xh = jQuery(this).data('first-height');
|
||||
if(typeof xh != 'undefined' && xh != '')
|
||||
jQuery(this).height(xh);
|
||||
//if(circle_type == 'right-circle' || circle_type == 'left-circle')
|
||||
//console.log('hi');
|
||||
|
||||
//var xw = jQuery(this).data('first-width');
|
||||
//if(typeof xw != 'undefined' && xw != '')
|
||||
jQuery(this).width('100%');
|
||||
make_info_circle('.info-c-full-br',resizedd);
|
||||
}
|
||||
}
|
||||
|
||||
var icon_height = jQuery(this).find('.info-circle-icons').outerHeight();
|
||||
var icon_width = jQuery(this).find('.info-circle-icons').outerHeight();
|
||||
|
||||
if(circle_type != 'full-circle')
|
||||
{
|
||||
var wrapper_height = jQuery(this).outerHeight();
|
||||
var wrapper_width = jQuery(this).outerWidth();
|
||||
var margin_top = jQuery(this).css('margin-top');
|
||||
var margin_bottom = jQuery(this).css('margin-bottom');
|
||||
|
||||
var wrapper_inner_width = jQuery(this).children().outerWidth();
|
||||
|
||||
var info_margin = parseInt(jQuery(this).find('.info-c-full').css('margin-top').replace(/[^-\d\.]/g, ''));
|
||||
var info_padding = parseInt(jQuery(this).find('.info-c-full').css('padding-top').replace(/[^-\d\.]/g, ''));
|
||||
|
||||
if(circle_type == 'top-circle' || circle_type == 'bottom-circle')
|
||||
{
|
||||
jQuery(this).css({'overflow':'hidden'});
|
||||
|
||||
var info_width = jQuery(this).find('.info-c-full').outerWidth();
|
||||
var info_width_inner = jQuery(this).find('.info-c-full').width();
|
||||
|
||||
if(circle_type == 'top-circle')
|
||||
{
|
||||
var hidden_height = (percentage/100)*wrapper_height;
|
||||
jQuery(this).css({'padding-top':margin_top, 'height' : hidden_height, 'margin-bottom' : 0});
|
||||
|
||||
var info_wrap_height = hidden_height - info_margin - parseInt(margin_top.replace(/[^-\d\.]/g, '')) - info_padding-(info_padding/2);
|
||||
//var info_wrap_height = hidden_height/2;
|
||||
jQuery(this).find('.info-c-full-wrap').css({'height':info_wrap_height});
|
||||
}
|
||||
else if(circle_type == 'bottom-circle')
|
||||
{
|
||||
var temp_hidden_height = ((100-percentage)/100)*wrapper_height;
|
||||
|
||||
var hidden_height = wrapper_height-temp_hidden_height+10;
|
||||
|
||||
jQuery(this).css({'padding-bottom':margin_bottom, 'height' : hidden_height, 'margin-top':0});
|
||||
jQuery(this).children().css({'margin-top':-(temp_hidden_height+(icon_height/2))});
|
||||
|
||||
var info_wrap_height = hidden_height - info_margin - parseInt(margin_top.replace(/[^-\d\.]/g, '')) - info_padding-(info_padding/2);
|
||||
|
||||
// jQuery(this).find('.info-c-full-wrap').height(info_wrap_height);
|
||||
// var calculate_info_margin = info_width_inner-info_wrap_height;
|
||||
// jQuery(this).find('.info-c-full-wrap').css({'margin-top':calculate_info_margin+'px'});
|
||||
}
|
||||
}
|
||||
else if(circle_type == 'left-circle' || circle_type == 'right-circle')
|
||||
{
|
||||
jQuery(this).css({'overflow':'hidden','padding-top':margin_top, 'padding-bottom':margin_bottom});
|
||||
|
||||
var info_width = jQuery(this).find('.info-c-full').outerWidth();
|
||||
var info_width_inner = jQuery(this).find('.info-c-full').width();
|
||||
|
||||
if(circle_type == 'left-circle')
|
||||
{
|
||||
var hidden_width = (percentage/100)*wrapper_inner_width;
|
||||
jQuery(this).css({'width' : hidden_width, 'padding-left':margin_top});
|
||||
jQuery(this).children().css({'width' : wrapper_inner_width,'max-width':wrapper_inner_width});
|
||||
|
||||
var cal_width = hidden_width-info_margin-(info_padding+(info_padding/2))-parseInt(margin_top.replace(/[^-\d\.]/g, ''));
|
||||
jQuery(this).find('.info-c-full-wrap').width(cal_width);
|
||||
}
|
||||
else if(circle_type == 'right-circle')
|
||||
{
|
||||
var temp_hidden_width = ((100-percentage)/100)*wrapper_inner_width;
|
||||
var hidden_width = parseInt(wrapper_inner_width-temp_hidden_width);
|
||||
jQuery(this).css({'width' : hidden_width, 'padding-right':margin_top});
|
||||
jQuery(this).children().css({'margin-left':-(temp_hidden_width+(icon_width/2)), 'max-width':wrapper_inner_width, 'width' : wrapper_inner_width});
|
||||
|
||||
var gap = temp_hidden_width - info_margin;
|
||||
gap = gap + parseInt(margin_top.replace(/[^-\d\.]/g, '')) - info_padding;
|
||||
|
||||
var cal_width = hidden_width-info_margin-parseInt(margin_top.replace(/[^-\d\.]/g, '')) - info_padding;
|
||||
var cal_left = gap;
|
||||
jQuery(this).find('.info-c-full-wrap').width(cal_width);
|
||||
jQuery(this).find('.info-c-full-wrap').css({'margin-left':cal_left+'px'});
|
||||
}
|
||||
}
|
||||
}
|
||||
if(responsive == 'on')
|
||||
{
|
||||
var breakpoint = jQuery(this).children().data('responsive-breakpoint');
|
||||
var win = jQuery(window).width();
|
||||
if(win <= breakpoint)
|
||||
{
|
||||
jQuery(this).css({'width':'auto','overflow':'visible', 'height' : 'auto', 'padding' : 0});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function info_circle_slide (delay,identity) {
|
||||
identity.bsf_appear(function(){
|
||||
setInterval(function(){
|
||||
if(identity.attr('data-slide-true')=='on'){
|
||||
var myindex = identity.attr('data-slide-number')*1;
|
||||
//console.log('slideTo'+myindex);
|
||||
var len = identity.find('.info-circle-icons').length;
|
||||
if(identity.data('info-circle-angle')!='full'){
|
||||
if(len-1 == myindex)
|
||||
myindex=0;
|
||||
}else{
|
||||
if(len== myindex)
|
||||
myindex=0;
|
||||
}
|
||||
var obj = identity.find('.info-circle-icons').eq(myindex);
|
||||
identity.attr('data-slide-number',myindex+1);
|
||||
show_next_info_circle(obj);
|
||||
}
|
||||
},delay);
|
||||
/*
|
||||
clearTimeout(time_f_arr[identity.data('timeout-fn')]);
|
||||
var time_fn = 'tf'+(Math.random().toString(36).slice(2));
|
||||
identity.data('timeout-fn',time_fn);
|
||||
time_f_arr[time_fn] = setTimeout(function() {
|
||||
if(identity.attr('data-slide-true')=='true'){
|
||||
info_circle_slide(++myindex,delay,identity);
|
||||
}
|
||||
}, delay);*/
|
||||
});
|
||||
}
|
||||
function show_next_info_circle(obj){
|
||||
var highlight_style= obj.parents('.info-c-full-br').data('highlight-style');
|
||||
if(highlight_style!=''){
|
||||
obj.parents('.info-c-full-br').find('.'+highlight_style).removeClass(highlight_style).removeClass('info-circle-active');
|
||||
obj.addClass(highlight_style).addClass('info-circle-active');
|
||||
}
|
||||
var txt = obj.next();
|
||||
var cont_f_size =obj.parents('.info-c-full-br').data('icon-show-size');
|
||||
if(obj.parents('.info-c-full-br').data('icon-show')=='not-show'){
|
||||
txt.find('i.info-circle-icon').remove();
|
||||
txt.find('img.info-circle-img-icon').remove();
|
||||
obj.parents('.info-c-full-br').find('.info-c-full').addClass('circle-noicon');
|
||||
}
|
||||
txt = txt.html();
|
||||
//obj.parents('.icon-circle-list').find('.info-details').animate({opacity:0});
|
||||
//obj.next().animate({opacity:1});
|
||||
//obj.parents('.info-c-full-br').find('.info-details').animate({opacity:0},'slow');
|
||||
var size = obj.css('font-size');
|
||||
var bg_col = obj.attr('style')
|
||||
//var p = bg_col.indexOf('background-color');
|
||||
//bg_col = bg_col.substr(p);
|
||||
//bg_col = bg_col.split(';');
|
||||
//bg_col= bg_col[0];
|
||||
//bg_col = bg_col.substr(17);
|
||||
var obj_par = obj.parents('.info-c-full-br');
|
||||
obj_par.find('.info-c-full-wrap').stop().animate({opacity:0},'slow',function(){
|
||||
//obj.parents('.info-c-full-br').find('.info-c-full').animate({opacity:1},'fast',function(){
|
||||
//obj.parents('.info-c-full-br').find('.info-c-full').css('color',obj.css('color'));
|
||||
obj.parents('.info-c-full-br').find('.info-c-full .info-c-full-wrap').html(txt);
|
||||
//obj.parents('.info-c-full-br').find('.info-c-full i').css({'font-size':(parseInt(size)*2.5)+'px'});
|
||||
//obj.parents('.info-c-full-br').find('.info-c-full img').css({'width':(parseInt(size)*2.5)+'px','margin-top':'20px'});
|
||||
obj_par.find('.info-c-full i').css({'font-size':parseInt(cont_f_size)+'px'});
|
||||
obj_par.find('.info-c-full .info-circle-img-icon').css({'width':parseInt(cont_f_size)+'px'});
|
||||
//obj.parents('.info-c-full-br').find('.info-c-full').css('background-color',bg_col);
|
||||
obj.parents('.info-c-full-br').find('.info-c-full-wrap').animate({opacity:1},'slow');
|
||||
});
|
||||
}
|
||||
function responsive_check(obj){
|
||||
jQuery(obj).each(function(){
|
||||
if(jQuery(this).data('responsive-circle')=='on'){
|
||||
var parent = jQuery(this).parent();
|
||||
var uniq = parent.data('uniqid');
|
||||
var breakpoint = jQuery(this).data('responsive-breakpoint');
|
||||
var wrapper_id = 'info-circle-wrapper-'+uniq;
|
||||
var css = '<style>@media(max-width:'+breakpoint+'px){ #'+wrapper_id+' .smile_icon_list_wrap{ display: block; margin-top: auto !important; } #'+wrapper_id+' .info-c-full-br{ display: none; } .smile_icon_list_wrap { margin-left:auto !important; max-width:inherit !important; width:auto !important; } .info-circle-responsive .info-circle-def { display: block; width: auto; height: auto; } .info-circle-responsive .info-circle-sub-def { display: block; vertical-align: top; } }</style>';
|
||||
jQuery('head').append(css);
|
||||
|
||||
var circle_list = jQuery(this).parent().find('.smile_icon_list_wrap .smile_icon_list');
|
||||
var circle_list_item = circle_list.find('.icon_list_item').clone();
|
||||
circle_list.find('.icon_list_item').remove();
|
||||
var list_bg_col = jQuery(this).next().data('content_bg')
|
||||
var list_col = jQuery(this).next().data('content_color')
|
||||
jQuery(this).find('.icon-circle-list .info-details').each(function(){
|
||||
var icon_class = jQuery(this).attr('data-icon-class');
|
||||
var heading = jQuery(this).find('.info-circle-heading').html();
|
||||
var text = jQuery(this).find('.info-circle-text').html();
|
||||
var bg = jQuery(this).prev().css('background-color');
|
||||
var color = jQuery(this).prev().css('color');
|
||||
var border_style = jQuery(this).prev().css('border');
|
||||
var icon = jQuery(this).find('.info-circle-sub-def').children().eq(0).clone();
|
||||
circle_list_item.find('.icon_list_icon').html(icon.wrap("<div />").parent().html());
|
||||
circle_list_item.find('.icon_description').css('color',list_col);
|
||||
circle_list_item.find('.icon_description').css('background-color',list_bg_col);
|
||||
circle_list_item.find('.icon_description h3').html(heading);
|
||||
circle_list_item.find('.icon_description p').html(text);
|
||||
circle_list_item.find('.icon_list_icon').css({'background-color':bg,'color':color,'border':border_style});
|
||||
circle_list_item.addClass(icon_class);
|
||||
circle_list.append(circle_list_item.wrap("<div />").parent().html());
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
function make_info_circle(selector,resized){
|
||||
jQuery(selector).each(function(k,circle_item){
|
||||
var f_size = jQuery(circle_item).data('icon-size');
|
||||
jQuery(jQuery(circle_item).find(".icon-circle-list .info-circle-icons")).each(function(i,icon){
|
||||
var padding_value, icon_height, icon_width, icon_margin, icon_line_height;
|
||||
padding_value = jQuery(this).data('padding-style');
|
||||
var is_icon_wo_back = (jQuery(icon).hasClass('info-circle-icon-without-background')) ? true : false;
|
||||
if(!is_icon_wo_back) {
|
||||
if(padding_value != null) {
|
||||
icon_height = icon_width = icon_line_height = (f_size);
|
||||
icon_margin = f_size/2 + padding_value;
|
||||
}
|
||||
else {
|
||||
icon_height = icon_width = icon_line_height = (f_size*2);
|
||||
icon_margin = f_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
icon_height = icon_width = icon_line_height = f_size;
|
||||
icon_margin = (f_size/2);
|
||||
}
|
||||
jQuery(circle_item).parent().css({'margin-top':(icon_margin+10)+'px','margin-bottom':(icon_margin+10)+'px'});
|
||||
jQuery(this).css({"font-size":f_size+'px','height':icon_height+'px','width':icon_width+'px','margin':'-'+(icon_margin+'px'),'line-height':icon_line_height+'px'});
|
||||
});
|
||||
});
|
||||
if(selector=='.info-c-full-br'){
|
||||
jQuery(selector).each(function(){
|
||||
jQuery(this).css('height',jQuery(this).width());
|
||||
jQuery(this).css('opacity','1');
|
||||
});
|
||||
}
|
||||
if(selector=='.info-c-semi-br'){
|
||||
jQuery(selector).each(function(){
|
||||
var widd = jQuery(this).width();
|
||||
jQuery(this).css('height',((parseInt(widd))/2)+'px');
|
||||
var widd = widd+'px '+widd+'px '+' 0 0';
|
||||
jQuery(this).css('border-radius',widd);
|
||||
var i_widd = jQuery(this).find('.info-c-full').width();
|
||||
i_widd = i_widd+'px '+i_widd+'px '+'0 0';
|
||||
jQuery(this).find('.info-c-full').css('border-radius',i_widd);
|
||||
});
|
||||
}
|
||||
setTimeout(function() {
|
||||
if(resized == resizedd){
|
||||
if(selector=='.info-c-full-br'){
|
||||
part_circle_icon(selector);
|
||||
}
|
||||
if(selector=='.info-c-semi-br'){
|
||||
semi_circle_icon(selector);
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
function part_circle_icon(selector) {
|
||||
jQuery(selector).each(function(){
|
||||
|
||||
jQuery(this).bsf_appear(function(){
|
||||
if(jQuery(this).css('display')!='none'){
|
||||
var count = jQuery(this).find('.icon-circle-list .info-circle-icons').length;
|
||||
var p_arr=new Array();
|
||||
var r=(jQuery(this).outerWidth())/2;
|
||||
|
||||
var custom_degree = 0;
|
||||
var temp_degree = jQuery(this).data('start-degree');
|
||||
|
||||
if(typeof temp_degree !== 'undefined' || temp_degree != '')
|
||||
custom_degree = temp_degree;
|
||||
|
||||
var alt= 180/count;
|
||||
var pos=jQuery(this).data('info-circle-angle');
|
||||
var dev = jQuery(this).data('divert');
|
||||
|
||||
var temp_pos = '';
|
||||
|
||||
if(pos == 'full')
|
||||
{
|
||||
temp_pos = pos;
|
||||
pos = 180;
|
||||
alt=90;
|
||||
r = -r;
|
||||
}
|
||||
//pos = 180; // del on all option
|
||||
|
||||
var gap_required = 0;
|
||||
var less = false;
|
||||
for(i=1;i<=count;i++)
|
||||
{
|
||||
var angle = i * ((180+(2*alt))/count);
|
||||
if(temp_pos == 'full')
|
||||
{
|
||||
if(angle < custom_degree && i == 1)
|
||||
{
|
||||
gap_required = custom_degree - angle;
|
||||
less = false;
|
||||
}
|
||||
else if(angle > custom_degree && i == 1)
|
||||
{
|
||||
gap_required = angle - custom_degree;
|
||||
less = true;
|
||||
}
|
||||
|
||||
if(less == true)
|
||||
{
|
||||
angle-=gap_required;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle+=gap_required;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
angle = angle+pos-alt+dev;
|
||||
}
|
||||
|
||||
angle = (angle*0.0174532925);
|
||||
|
||||
p_arr.push( r * Math.cos(angle));
|
||||
p_arr.push( r * Math.sin(angle));
|
||||
}
|
||||
var i=0, delay=0;
|
||||
var launch = jQuery(this).data('launch');
|
||||
var launch_duration = jQuery(this).data('launch-duration');
|
||||
var launch_delay = jQuery(this).data('launch-delay');
|
||||
/*if(!launch){
|
||||
launch='easeOutExpo';
|
||||
}*/
|
||||
if(!launch_duration){
|
||||
launch_duration = 1;
|
||||
}
|
||||
if(!launch_delay){
|
||||
launch_delay= .15;
|
||||
}
|
||||
if(launch!=''){
|
||||
delay = -(launch_delay*1000);
|
||||
jQuery(this).find('.icon-circle-list .info-circle-icons').each(function(){
|
||||
var el = jQuery(this);
|
||||
delay+=(launch_delay*1000);
|
||||
setTimeout(function() {
|
||||
el.animate(
|
||||
{opacity:1,left:p_arr[i++],top:p_arr[i++]},
|
||||
{
|
||||
duration: (launch_duration)*1000,
|
||||
easing: launch
|
||||
});
|
||||
}, delay);
|
||||
})
|
||||
}
|
||||
else{
|
||||
jQuery(this).find('.icon-circle-list .info-circle-icons').each(function(){
|
||||
var el = jQuery(this);
|
||||
//el.animate({opacity:1,left:p_arr[i++],top:p_arr[i++]},(launch_duration)*1000,launch);
|
||||
el.css({'opacity':'1','left':p_arr[i++],"top":p_arr[i++]});
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
/*function semi_circle_icon(selector) {
|
||||
jQuery(selector).each(function(){
|
||||
if(jQuery(this).css('display')!='none'){
|
||||
var count = jQuery(this).find('.icon-circle-list .info-circle-icons').length;
|
||||
var p_arr=new Array();
|
||||
var r=(jQuery(this).width())/2;
|
||||
var alt= 180/count;
|
||||
var pos = 180;
|
||||
var dev = jQuery(this).data('divert');
|
||||
for(i=1;i<=count;i++)
|
||||
{
|
||||
var angle = i * ((180+(2*alt))/count);
|
||||
angle = angle+pos-alt+dev;
|
||||
//Do not delete these Comments
|
||||
//var angle = i * (90)/count;
|
||||
//angle = angle+270;
|
||||
//var angle = i* 360/count;
|
||||
//angle = angle+90;
|
||||
angle = (angle*0.0174532925);
|
||||
p_arr.push( r * Math.cos(angle));
|
||||
p_arr.push( r * Math.sin(angle));
|
||||
}
|
||||
var i=0, delay=0;
|
||||
var launch = jQuery(this).data('launch');
|
||||
var launch_duration = jQuery(this).data('launch-duration');
|
||||
var launch_delay = jQuery(this).data('launch-delay');
|
||||
if(!launch){
|
||||
launch='easeOutExpo';
|
||||
}
|
||||
if(!launch_duration){
|
||||
launch_duration = 1;
|
||||
}
|
||||
if(!launch_delay){
|
||||
launch_delay= .15;
|
||||
}
|
||||
delay = -(launch_delay*1000);
|
||||
jQuery(this).find('.icon-circle-list .info-circle-icons').each(function(){
|
||||
var el = jQuery(this);
|
||||
delay+=(launch_delay*1000);
|
||||
setTimeout(function() {
|
||||
el.animate({opacity:1,left:p_arr[i++],top:p_arr[i++]},(launch_duration)*1000,launch);
|
||||
}, delay);
|
||||
})
|
||||
}
|
||||
})
|
||||
}*/
|
||||
jQuery(window).load(function(){
|
||||
jQuery('.info-c-full-br').each(function(){
|
||||
if(jQuery(this).attr('data-slide-true')=='on'){
|
||||
jQuery(this).hover(function(){
|
||||
jQuery(this).attr('data-slide-true','off');
|
||||
},function(){
|
||||
jQuery(this).attr('data-slide-true','on');
|
||||
//info_circle_slide((jQuery(this).data('slide-duration'))*(1000),jQuery(this));
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(e) {
|
||||
jQuery(".icon_list_item").each(function(index, element) {
|
||||
var $this = jQuery(this);
|
||||
var count = $this.find(".info-circle-img-icon").length;
|
||||
if(count >= 1 ){
|
||||
$this.closest("ul.smile_icon_list").addClass("ic-resp-img");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
jQuery(document).ready(function(){
|
||||
/* vc hack by amit */
|
||||
jQuery('.upb_row_bg').each(function(index,urow){
|
||||
var row = jQuery(urow).parent();
|
||||
row[0].style.setProperty('background-image', 'none', 'important');
|
||||
});
|
||||
/* end */
|
||||
if(jQuery('.vcpb-fs-jquery').length > 0){
|
||||
if (!jQuery.event.special.frame) {
|
||||
// jquery.events.frame.js
|
||||
// 1.1 - lite
|
||||
// Stephen Band
|
||||
//
|
||||
// Project home:
|
||||
// webdev.stephband.info/events/frame/
|
||||
//
|
||||
// Source:
|
||||
// http://github.com/stephband/jquery.event.frame
|
||||
(function(d,h){function i(a,b){function e(){f.frameCount++;a.call(f)}var f=this,g;this.frameDuration=b||25;this.frameCount=-1;this.start=function(){e();g=setInterval(e,this.frameDuration)};this.stop=function(){clearInterval(g);g=null}}function j(){var a=d.event.special.frame.handler,b=d.Event("frame"),e=this.array,f=e.length;for(b.frameCount=this.frameCount;f--;)a.call(e[f],b)}var c;if(!d.event.special.frame)d.event.special.frame={setup:function(a){if(c)c.array.push(this);else{c=new i(j,a&&a.frameDuration);
|
||||
c.array=[this];var b=setTimeout(function(){c.start();clearTimeout(b);b=null},0)}},teardown:function(){for(var a=c.array,b=a.length;b--;)if(a[b]===this){a.splice(b,1);break}if(a.length===0){c.stop();c=h}},handler:function(){d.event.handle.apply(this,arguments)}}})(jQuery);
|
||||
}
|
||||
// jquery.jparallax.js
|
||||
// 1.0
|
||||
// Stephen Band
|
||||
//
|
||||
// Project and documentation site:
|
||||
// webdev.stephband.info/jparallax/
|
||||
//
|
||||
// Repository:
|
||||
// github.com/stephband/jparallax
|
||||
//
|
||||
// Dependencies:
|
||||
// jquery.event.frame
|
||||
(function(l,t){function y(i){return this.lib[i]}function q(i){return typeof i==="boolean"?i:!!parseFloat(i)}function r(i,b){var k=[q(i.xparallax),q(i.yparallax)];this.ontarget=false;this.decay=i.decay;this.pointer=b||[0.5,0.5];this.update=function(e,a){if(this.ontarget)this.pointer=e;else if((!k[0]||u(e[0]-this.pointer[0])<a[0])&&(!k[1]||u(e[1]-this.pointer[1])<a[1])){this.ontarget=true;this.pointer=e}else{a=[];for(var g=2;g--;)if(k[g])a[g]=e[g]+this.decay*(this.pointer[g]-e[g]);this.pointer=a}}}
|
||||
function z(i,b){var k=this,e=i instanceof l?i:l(i),a=[q(b.xparallax),q(b.yparallax)],g=0,d;this.pointer=[0,0];this.active=false;this.activeOutside=b&&b.activeOutside||false;this.update=function(h){var j=this.pos,c=this.size,f=[],m=2;if(g>0){if(g===2){g=0;if(d)h=d}for(;m--;)if(a[m]){f[m]=(h[m]-j[m])/c[m];f[m]=f[m]<0?0:f[m]>1?1:f[m]}this.active=true;this.pointer=f}else this.active=false};this.updateSize=function(){var h=e.width(),j=e.height();k.size=[h,j];k.threshold=[1/h,1/j]};this.updatePos=function(){var h=
|
||||
e.offset()||{left:0,top:0},j=parseInt(e.css("borderLeftWidth"))+parseInt(e.css("paddingLeft")),c=parseInt(e.css("borderTopWidth"))+parseInt(e.css("paddingTop"));k.pos=[h.left+j,h.top+c]};l(window).bind("resize",k.updateSize).bind("resize",k.updatePos);e.bind("mouseenter",function(){g=1}).bind("mouseleave",function(h){g=2;d=[h.pageX,h.pageY]});this.updateSize();this.updatePos()}function A(i,b){var k=[],e=[],a=[],g=[];this.update=function(d){for(var h=[],j,c,f=2,m={};f--;)if(e[f]){h[f]=e[f]*d[f]+a[f];
|
||||
if(k[f]){j=g[f];c=h[f]*-1}else{j=h[f]*100+"%";c=h[f]*this.size[f]*-1}if(f===0){m.left=j;m.marginLeft=c}else{m.top=j;m.marginTop=c}}i.css(m)};this.setParallax=function(d,h,j,c){d=[d||b.xparallax,h||b.yparallax];j=[j||b.xorigin,c||b.yorigin];for(c=2;c--;){k[c]=o.px.test(d[c]);if(typeof j[c]==="string")j[c]=o.percent.test(j[c])?parseFloat(j[c])/100:v[j[c]]||1;if(k[c]){e[c]=parseInt(d[c]);a[c]=j[c]*(this.size[c]-e[c]);g[c]=j[c]*100+"%"}else{e[c]=d[c]===true?1:o.percent.test(d[c])?parseFloat(d[c])/100:
|
||||
d[c];a[c]=e[c]?j[c]*(1-e[c]):0}}};this.getPointer=function(){for(var d=i.offsetParent(),h=i.position(),j=[],c=[],f=2;f--;){j[f]=k[f]?0:h[f===0?"left":"top"]/(d[f===0?"outerWidth":"outerHeight"]()-this.size[f]);c[f]=(j[f]-a[f])/e[f]}return c};this.setSize=function(d,h){this.size=[d||i.outerWidth(),h||i.outerHeight()]};this.setSize(b.width,b.height);this.setParallax(b.xparallax,b.yparallax,b.xorigin,b.yorigin)}function s(i){var b=l(this),k=i.data,e=b.data(n),a=k.port,g=k.mouse,d=e.mouse;if(k.timeStamp!==
|
||||
i.timeStamp){k.timeStamp=i.timeStamp;a.update(w);if(a.active||!g.ontarget)g.update(a.pointer,a.threshold)}if(d){d.update(e.freeze?e.freeze.pointer:a.pointer,a.threshold);if(d.ontarget){delete e.mouse;e.freeze&&b.unbind(p).addClass(k.freezeClass)}g=d}else g.ontarget&&!a.active&&b.unbind(p);e.layer.update(g.pointer)}var n="parallax",x={mouseport:"body",xparallax:true,yparallax:true,xorigin:0.5,yorigin:0.5,decay:0.66,frameDuration:30,freezeClass:"freeze"},v={left:0,top:0,middle:0.5,center:0.5,right:1,
|
||||
bottom:1},o={px:/^\d+\s?px$/,percent:/^\d+\s?%$/},p="frame."+n,u=Math.abs,w=[0,0];y.lib=v;l.fn[n]=function(i){var b=l.extend({},l.fn[n].options,i),k=arguments,e=this;if(!(b.mouseport instanceof l))b.mouseport=l(b.mouseport);b.port=new z(b.mouseport,b);b.mouse=new r(b);b.mouseport.bind("mouseenter",function(){b.mouse.ontarget=false;e.each(function(){var a=l(this);a.data(n).freeze||a.bind(p,b,s)})});return e.bind("freeze",function(a){var g=l(this),d=
|
||||
g.data(n),h=d.mouse||d.freeze||b.mouse,j=o.percent.exec(a.x)?parseFloat(a.x.replace(/%$/,""))/100:a.x||h.pointer[0],c=o.percent.exec(a.y)?parseFloat(a.y.replace(/%$/,""))/100:a.y||h.pointer[1];a=a.decay;d.freeze={pointer:[j,c]};d.mouse=new r(b,h.pointer);if(a!==t)d.mouse.decay=a;g.bind(p,b,s)}).bind("unfreeze",function(a){var g=l(this),d=g.data(n);a=a.decay;var h;if(d.freeze){h=d.mouse?d.mouse.pointer:d.freeze.pointer;d.mouse=new r(b);d.mouse.pointer=h;if(a!==t)d.mouse.decay=a;delete d.freeze;g.removeClass(x.freezeClass).bind(p,
|
||||
b,s)}}).each(function(a){var g=l(this);a=k[a+1]?l.extend({},b,k[a+1]):b;var d=new A(g,a);g.data(n,{layer:d,mouse:new r(a,d.getPointer())})})};l.fn[n].options=x;l(document).ready(function(){l(document).mousemove(function(i){w=[i.pageX,i.pageY]})})})(jQuery);
|
||||
//if(! jQuery.browser.mobile){
|
||||
jQuery('.vcpb-fs-jquery').each(function(){
|
||||
var selector = jQuery(this);
|
||||
var sense = selector.data('parallax_sense');
|
||||
var incr =(selector.outerWidth()*(sense/100));
|
||||
var img_list = selector.data('img-array');
|
||||
img_list = img_list.split(',');
|
||||
var img_list_len = img_list.length;
|
||||
for (var i = 0; i < img_list_len; i++) {
|
||||
jQuery(selector).prepend('<img class="ultimate_h_parallax" src="'+img_list[i]+'"></div>')
|
||||
};
|
||||
var hp = jQuery(selector).find('.ultimate_h_parallax');
|
||||
hp.css({'max-width':'none','position':'absolute'});
|
||||
hp.css('min-width',(hp.parent().outerWidth())+incr+'px');
|
||||
});
|
||||
var resiz = function(){
|
||||
jQuery('.vcpb-fs-jquery').each(function(){
|
||||
var selector = jQuery(this);
|
||||
var sense = selector.data('parallax_sense');
|
||||
var incr =(selector.outerWidth()*(sense/100));
|
||||
var hp = jQuery(selector).find('.ultimate_h_parallax');
|
||||
if(hp.parent().outerHeight()>hp.outerHeight()){
|
||||
hp.css('min-height',(hp.parent().outerHeight())+incr+'px')
|
||||
}
|
||||
if(hp.outerHeight()>hp.outerWidth()){
|
||||
hp.css('width','auto')
|
||||
}
|
||||
jQuery(selector).css('background-image','')
|
||||
})
|
||||
}
|
||||
resiz();
|
||||
jQuery(window).resize(function(){
|
||||
resiz();
|
||||
})
|
||||
jQuery(window).load(function(){
|
||||
jQuery('.vcpb-fs-jquery').each(function(){
|
||||
var layer_count = jQuery(this).find('.ultimate_h_parallax').length;
|
||||
layer_count = 1/layer_count;
|
||||
var lay_opt = new Array();
|
||||
jQuery(this).find('.ultimate_h_parallax').each(function(index){
|
||||
lay_opt.push("{'xparallax':"+ layer_count*(index+1)+" , 'yparallax':"+ layer_count*(index+1)+"}");
|
||||
})
|
||||
lay_opt = lay_opt.join(",");
|
||||
|
||||
if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
|
||||
var is_mobile = 'false';
|
||||
else
|
||||
var is_mobile = 'true';
|
||||
|
||||
var is_img_parallax_disable_on_mobile = jQuery(this).parent().data('img-parallax-mobile-disable').toString();
|
||||
if(is_mobile == 'true' && is_img_parallax_disable_on_mobile == 'true')
|
||||
var disable_row_effect = 'true';
|
||||
else
|
||||
var disable_row_effect = 'false';
|
||||
|
||||
if(disable_row_effect == 'false')
|
||||
eval("jQuery(this).find('.ultimate_h_parallax').parallax({mouseport: jQuery(this).parent()},"+lay_opt+"); var mouse = {x: 0, y: 0}; document.addEventListener('mousemove', function(e){ mouse.x = e.clientX || e.pageX; mouse.y = e.clientY || e.pageY; jQuery(this).parent().trigger({type: 'mousemove', pageX: mouse.x, pageY: mouse.y }); }, true); jQuery(this).parent().trigger({type: 'mouseenter', pageX: 0, pageY: 0}); var x = 1; document.onmousemove = document.onmouseover = function (e) { if(x > 1) return false; mouse.x = e.clientX || e.pageX; mouse.y = e.clientY || e.pageY; x++; if(x == 2) jQuery(this).parent().trigger({type: 'mousemove', pageX: mouse.x, pageY: mouse.y }); }");
|
||||
})
|
||||
})
|
||||
//}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,123 @@
|
||||
/** jQuery.bsf_appear
|
||||
* https://github.com/bas2k/jquery.bsf_appear/
|
||||
* http://code.google.com/p/jquery-bsf_appear/
|
||||
*
|
||||
* Copyright (c) 2009 Michael Hixson
|
||||
* Copyright (c) 2012 Alexander Brovikov
|
||||
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
(function($) {
|
||||
$.fn.bsf_appear = function(fn, options) {
|
||||
var settings = $.extend({
|
||||
//arbitrary data to pass to fn
|
||||
data: undefined,
|
||||
//call fn only on the first bsf_appear?
|
||||
one: true,
|
||||
// X & Y accuracy
|
||||
accX: 0,
|
||||
accY: 0
|
||||
}, options);
|
||||
return this.each(function() {
|
||||
var t = $(this);
|
||||
//whether the element is currently visible
|
||||
t.bsf_appeared = false;
|
||||
if (!fn) {
|
||||
//trigger the custom event
|
||||
t.trigger('bsf_appear', settings.data);
|
||||
return;
|
||||
}
|
||||
var w = $(window);
|
||||
//fires the bsf_appear event when appropriate
|
||||
var check = function() {
|
||||
//is the element hidden?
|
||||
if (!t.is(':visible')) {
|
||||
//it became hidden
|
||||
t.bsf_appeared = false;
|
||||
return;
|
||||
}
|
||||
//is the element inside the visible window?
|
||||
var a = w.scrollLeft();
|
||||
var b = w.scrollTop();
|
||||
var o = t.offset();
|
||||
var x = o.left;
|
||||
var y = o.top;
|
||||
var ax = settings.accX;
|
||||
var ay = settings.accY;
|
||||
var th = t.height();
|
||||
var wh = w.height();
|
||||
var tw = t.width();
|
||||
var ww = w.width();
|
||||
if (y + th + ay >= b &&
|
||||
y <= b + wh + ay &&
|
||||
x + tw + ax >= a &&
|
||||
x <= a + ww + ax) {
|
||||
//trigger the custom event
|
||||
if (!t.bsf_appeared) t.trigger('bsf_appear', settings.data);
|
||||
} else {
|
||||
//it scrolled out of view
|
||||
t.bsf_appeared = false;
|
||||
}
|
||||
};
|
||||
//create a modified fn with some additional logic
|
||||
var modifiedFn = function() {
|
||||
//mark the element as visible
|
||||
t.bsf_appeared = true;
|
||||
//is this supposed to happen only once?
|
||||
if (settings.one) {
|
||||
//remove the check
|
||||
w.unbind('scroll', check);
|
||||
var i = $.inArray(check, $.fn.bsf_appear.checks);
|
||||
if (i >= 0) $.fn.bsf_appear.checks.splice(i, 1);
|
||||
}
|
||||
//trigger the original fn
|
||||
fn.apply(this, arguments);
|
||||
};
|
||||
//bind the modified fn to the element
|
||||
if (settings.one) t.one('bsf_appear', settings.data, modifiedFn);
|
||||
else t.bind('bsf_appear', settings.data, modifiedFn);
|
||||
//check whenever the window scrolls
|
||||
w.scroll(check);
|
||||
//check whenever the dom changes
|
||||
$.fn.bsf_appear.checks.push(check);
|
||||
//check now
|
||||
(check)();
|
||||
});
|
||||
};
|
||||
//keep a queue of bsf_appearance checks
|
||||
$.extend($.fn.bsf_appear, {
|
||||
checks: [],
|
||||
timeout: null,
|
||||
//process the queue
|
||||
checkAll: function() {
|
||||
var length = $.fn.bsf_appear.checks.length;
|
||||
|
||||
if (length > 0){
|
||||
while (length--) {
|
||||
($.fn.bsf_appear.checks[length])();
|
||||
}
|
||||
}
|
||||
},
|
||||
//check the queue asynchronously
|
||||
run: function() {
|
||||
if ($.fn.bsf_appear.timeout) {
|
||||
clearTimeout($.fn.bsf_appear.timeout);
|
||||
$.fn.bsf_appear.timeout = setTimeout($.fn.bsf_appear.checkAll, 20);
|
||||
} else {
|
||||
$.fn.bsf_appear.timeout = setTimeout($.fn.bsf_appear.checkAll, 20);
|
||||
}
|
||||
}
|
||||
});
|
||||
//run checks when these methods are called
|
||||
$.each(['append', 'prepend', 'after', 'before', 'attr',
|
||||
'removeAttr', 'addClass', 'removeClass', 'toggleClass',
|
||||
'remove', 'css', 'show', 'hide'], function(i, n) {
|
||||
var old = $.fn[n];
|
||||
if (old) {
|
||||
$.fn[n] = function() {
|
||||
var r = old.apply(this, arguments);
|
||||
$.fn.bsf_appear.run();
|
||||
return r;
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,158 @@
|
||||
/*!
|
||||
* Copyright (c) 2012 Ben Olson (https://github.com/bseth99/jquery-ui-extensions)
|
||||
* jQuery UI LabeledSlider @VERSION
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.slider.js
|
||||
*/
|
||||
|
||||
(function( $, undefined ) {
|
||||
|
||||
|
||||
$.widget( "ui.labeledslider", $.ui.slider, {
|
||||
|
||||
version: "@VERSION",
|
||||
|
||||
options: {
|
||||
tickInterval: 0,
|
||||
tweenLabels: true,
|
||||
tickLabels: null,
|
||||
tickArray: []
|
||||
},
|
||||
|
||||
uiSlider: null,
|
||||
tickInterval: 0,
|
||||
tweenLabels: true,
|
||||
|
||||
_create: function( ) {
|
||||
|
||||
this._detectOrientation();
|
||||
|
||||
this.uiSlider =
|
||||
this.element
|
||||
.wrap( '<div class="ui-slider-wrapper ui-widget"></div>' )
|
||||
.before( '<div class="ui-slider-labels"></div>' )
|
||||
.parent()
|
||||
.addClass( this.orientation )
|
||||
.css( 'font-size', this.element.css('font-size') );
|
||||
|
||||
this._super();
|
||||
|
||||
this.element.removeClass( 'ui-widget' )
|
||||
|
||||
this._alignWithStep();
|
||||
|
||||
if ( this.orientation == 'horizontal' ) {
|
||||
this.uiSlider
|
||||
.width( this.element.css('width') );
|
||||
} else {
|
||||
this.uiSlider
|
||||
.height( this.element.css('height') );
|
||||
}
|
||||
|
||||
this._drawLabels();
|
||||
},
|
||||
|
||||
_drawLabels: function () {
|
||||
|
||||
var labels = this.options.tickLabels || {},
|
||||
$lbl = this.uiSlider.children( '.ui-slider-labels' ),
|
||||
dir = this.orientation == 'horizontal' ? 'left' : 'bottom',
|
||||
min = this.options.min,
|
||||
max = this.options.max,
|
||||
inr = this.tickInterval,
|
||||
cnt = ( max - min ),
|
||||
tickArray = this.options.tickArray,
|
||||
ta = tickArray.length > 0,
|
||||
label, pt,
|
||||
i = 0;
|
||||
|
||||
$lbl.html('');
|
||||
|
||||
for (;i<=cnt;i++) {
|
||||
|
||||
if ( ( !ta && i%inr == 0 ) || ( ta && tickArray.indexOf( i+min ) > -1 ) ) {
|
||||
|
||||
label = labels[i+min] ? labels[i+min] : (this.options.tweenLabels ? i+min : '');
|
||||
|
||||
$('<div>').addClass( 'ui-slider-label-ticks'+' ult-slider-ticks'+(i+1) )
|
||||
.css( dir, (Math.round( ( i / cnt ) * 10000 ) / 100) + '%' )
|
||||
.html( '<span>'+( label )+'</span>' )
|
||||
.appendTo( $lbl );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_setOption: function( key, value ) {
|
||||
|
||||
this._super( key, value );
|
||||
|
||||
switch ( key ) {
|
||||
|
||||
case 'tickInterval':
|
||||
case 'tickLabels':
|
||||
case 'tickArray':
|
||||
case 'min':
|
||||
case 'max':
|
||||
case 'step':
|
||||
|
||||
this._alignWithStep();
|
||||
this._drawLabels();
|
||||
break;
|
||||
|
||||
case 'orientation':
|
||||
|
||||
this.element
|
||||
.removeClass( 'horizontal vertical' )
|
||||
.addClass( this.orientation );
|
||||
|
||||
this._drawLabels();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_alignWithStep: function () {
|
||||
if ( this.options.tickInterval < this.options.step )
|
||||
this.tickInterval = this.options.step;
|
||||
else
|
||||
this.tickInterval = this.options.tickInterval;
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
this._super();
|
||||
this.uiSlider.replaceWith( this.element );
|
||||
},
|
||||
|
||||
widget: function() {
|
||||
return this.uiSlider;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,251 @@
|
||||
// Generated by CoffeeScript 1.9.2
|
||||
|
||||
/**
|
||||
@license Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var $, win;
|
||||
|
||||
$ = this.jQuery || window.jQuery;
|
||||
|
||||
win = $(window);
|
||||
|
||||
$.fn.stick_in_parent = function(opts) {
|
||||
var doc, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, parent_selector, recalc_every, sticky_class;
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming;
|
||||
if (offset_top == null) {
|
||||
offset_top = 0;
|
||||
}
|
||||
if (parent_selector == null) {
|
||||
parent_selector = void 0;
|
||||
}
|
||||
if (inner_scrolling == null) {
|
||||
inner_scrolling = true;
|
||||
}
|
||||
if (sticky_class == null) {
|
||||
sticky_class = "is_stuck";
|
||||
}
|
||||
doc = $(document);
|
||||
if (enable_bottoming == null) {
|
||||
enable_bottoming = true;
|
||||
}
|
||||
fn = function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) {
|
||||
var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick;
|
||||
if (elm.data("sticky_kit")) {
|
||||
return;
|
||||
}
|
||||
elm.data("sticky_kit", true);
|
||||
last_scroll_height = doc.height();
|
||||
parent = elm.parent();
|
||||
if (parent_selector != null) {
|
||||
parent = parent.closest(parent_selector);
|
||||
}
|
||||
if (!parent.length) {
|
||||
throw "failed to find stick parent";
|
||||
}
|
||||
fixed = false;
|
||||
bottomed = false;
|
||||
spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $("<div />");
|
||||
if (spacer) {
|
||||
spacer.css('position', elm.css('position'));
|
||||
}
|
||||
recalc = function() {
|
||||
var border_top, padding_top, restore;
|
||||
if (detached) {
|
||||
return;
|
||||
}
|
||||
last_scroll_height = doc.height();
|
||||
border_top = parseInt(parent.css("border-top-width"), 10);
|
||||
padding_top = parseInt(parent.css("padding-top"), 10);
|
||||
padding_bottom = parseInt(parent.css("padding-bottom"), 10);
|
||||
parent_top = parent.offset().top + border_top + padding_top;
|
||||
parent_height = parent.height();
|
||||
if (fixed) {
|
||||
fixed = false;
|
||||
bottomed = false;
|
||||
if (manual_spacer == null) {
|
||||
elm.insertAfter(spacer);
|
||||
spacer.detach();
|
||||
}
|
||||
elm.css({
|
||||
position: "",
|
||||
top: "",
|
||||
width: "",
|
||||
bottom: ""
|
||||
}).removeClass(sticky_class);
|
||||
restore = true;
|
||||
}
|
||||
top = elm.offset().top - (parseInt(elm.css("margin-top"), 10) || 0) - offset_top;
|
||||
height = elm.outerHeight(true);
|
||||
el_float = elm.css("float");
|
||||
if (spacer) {
|
||||
spacer.css({
|
||||
width: elm.outerWidth(true),
|
||||
height: height,
|
||||
display: elm.css("display"),
|
||||
"vertical-align": elm.css("vertical-align"),
|
||||
"float": el_float
|
||||
});
|
||||
}
|
||||
if (restore) {
|
||||
return tick();
|
||||
}
|
||||
};
|
||||
recalc();
|
||||
if (height === parent_height) {
|
||||
return;
|
||||
}
|
||||
last_pos = void 0;
|
||||
offset = offset_top;
|
||||
recalc_counter = recalc_every;
|
||||
tick = function() {
|
||||
var css, delta, recalced, scroll, will_bottom, win_height;
|
||||
if (detached) {
|
||||
return;
|
||||
}
|
||||
recalced = false;
|
||||
if (recalc_counter != null) {
|
||||
recalc_counter -= 1;
|
||||
if (recalc_counter <= 0) {
|
||||
recalc_counter = recalc_every;
|
||||
recalc();
|
||||
recalced = true;
|
||||
}
|
||||
}
|
||||
if (!recalced && doc.height() !== last_scroll_height) {
|
||||
recalc();
|
||||
recalced = true;
|
||||
}
|
||||
scroll = win.scrollTop();
|
||||
if (last_pos != null) {
|
||||
delta = scroll - last_pos;
|
||||
}
|
||||
last_pos = scroll;
|
||||
if (fixed) {
|
||||
if (enable_bottoming) {
|
||||
will_bottom = scroll + height + offset > parent_height + parent_top;
|
||||
if (bottomed && !will_bottom) {
|
||||
bottomed = false;
|
||||
elm.css({
|
||||
position: "fixed",
|
||||
bottom: "",
|
||||
top: offset
|
||||
}).trigger("sticky_kit:unbottom");
|
||||
}
|
||||
}
|
||||
if (scroll < top) {
|
||||
fixed = false;
|
||||
offset = offset_top;
|
||||
if (manual_spacer == null) {
|
||||
if (el_float === "left" || el_float === "right") {
|
||||
elm.insertAfter(spacer);
|
||||
}
|
||||
spacer.detach();
|
||||
}
|
||||
css = {
|
||||
position: "",
|
||||
width: "",
|
||||
top: ""
|
||||
};
|
||||
elm.css(css).removeClass(sticky_class).trigger("sticky_kit:unstick");
|
||||
}
|
||||
if (inner_scrolling) {
|
||||
win_height = win.height();
|
||||
if (height + offset_top > win_height) {
|
||||
if (!bottomed) {
|
||||
offset -= delta;
|
||||
offset = Math.max(win_height - height, offset);
|
||||
offset = Math.min(offset_top, offset);
|
||||
if (fixed) {
|
||||
elm.css({
|
||||
top: offset + "px"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (scroll > top) {
|
||||
fixed = true;
|
||||
css = {
|
||||
position: "fixed",
|
||||
top: offset
|
||||
};
|
||||
css.width = elm.css("box-sizing") === "border-box" ? elm.outerWidth() + "px" : elm.width() + "px";
|
||||
elm.css(css).addClass(sticky_class);
|
||||
if (manual_spacer == null) {
|
||||
elm.after(spacer);
|
||||
if (el_float === "left" || el_float === "right") {
|
||||
spacer.append(elm);
|
||||
}
|
||||
}
|
||||
elm.trigger("sticky_kit:stick");
|
||||
}
|
||||
}
|
||||
if (fixed && enable_bottoming) {
|
||||
if (will_bottom == null) {
|
||||
will_bottom = scroll + height + offset > parent_height + parent_top;
|
||||
}
|
||||
if (!bottomed && will_bottom) {
|
||||
bottomed = true;
|
||||
if (parent.css("position") === "static") {
|
||||
parent.css({
|
||||
position: "relative"
|
||||
});
|
||||
}
|
||||
return elm.css({
|
||||
position: "absolute",
|
||||
bottom: padding_bottom,
|
||||
top: "auto"
|
||||
}).trigger("sticky_kit:bottom");
|
||||
}
|
||||
}
|
||||
};
|
||||
recalc_and_tick = function() {
|
||||
recalc();
|
||||
return tick();
|
||||
};
|
||||
detach = function() {
|
||||
detached = true;
|
||||
win.off("touchmove", tick);
|
||||
win.off("scroll", tick);
|
||||
win.off("resize", recalc_and_tick);
|
||||
$(document.body).off("sticky_kit:recalc", recalc_and_tick);
|
||||
elm.off("sticky_kit:detach", detach);
|
||||
elm.removeData("sticky_kit");
|
||||
elm.css({
|
||||
position: "",
|
||||
bottom: "",
|
||||
top: "",
|
||||
width: ""
|
||||
});
|
||||
parent.position("position", "");
|
||||
if (fixed) {
|
||||
if (manual_spacer == null) {
|
||||
if (el_float === "left" || el_float === "right") {
|
||||
elm.insertAfter(spacer);
|
||||
}
|
||||
spacer.remove();
|
||||
}
|
||||
return elm.removeClass(sticky_class);
|
||||
}
|
||||
};
|
||||
win.on("touchmove", tick);
|
||||
win.on("scroll", tick);
|
||||
win.on("resize", recalc_and_tick);
|
||||
$(document.body).on("sticky_kit:recalc", recalc_and_tick);
|
||||
elm.on("sticky_kit:detach", detach);
|
||||
return setTimeout(tick, 0);
|
||||
};
|
||||
for (i = 0, len = this.length; i < len; i++) {
|
||||
elm = this[i];
|
||||
fn($(elm));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
@@ -0,0 +1 @@
|
||||
/*!
* Masonry PACKAGED v3.1.4
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
* by David DeSandro
*/
(function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function o(e,i){t.fn[e]=function(o){if("string"==typeof o){for(var s=n.call(arguments,1),a=0,h=this.length;h>a;a++){var p=this[a],u=t.data(p,e);if(u)if(t.isFunction(u[o])&&"_"!==o.charAt(0)){var f=u[o].apply(u,s);if(void 0!==f)return f}else r("no such method '"+o+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+o+"'")}return this}return this.each(function(){var n=t.data(this,e);n?(n.option(o),n._init()):(n=new i(this,o),t.data(this,e,n))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),o(t,e)},t.bridget}}var n=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,n=function(){};i.addEventListener?n=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(n=function(t,i,n){t[i+n]=n.handleEvent?function(){var i=e(t);n.handleEvent.call(n,i)}:function(){var i=e(t);n.call(t,i)},t.attachEvent("on"+i,t[i+n])});var o=function(){};i.removeEventListener?o=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(o=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var r={bind:n,unbind:o};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==o.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var n=0,s=r.length;s>n;n++){var a=r[n];a()}}}function n(n){return n.bind(o,"DOMContentLoaded",i),n.bind(o,"readystatechange",i),n.bind(t,"load",i),e}var o=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],n)):t.docReady=n(t.eventie)}(this),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var n=t.prototype,o=this,r=o.EventEmitter;n.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},n.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},n.addListener=function(t,i){var n,o=this.getListenersAsObject(t),r="object"==typeof i;for(n in o)o.hasOwnProperty(n)&&-1===e(o[n],i)&&o[n].push(r?i:{listener:i,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,i){var n,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(n=e(r[o],i),-1!==n&&r[o].splice(n,1));return this},n.off=i("removeListener"),n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].length;n--;)i=s[o][n],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},n.trigger=i("emitEvent"),n.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},n.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return o.EventEmitter=r,t},"functionLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,418 @@
|
||||
(function($) {
|
||||
var triggerBttn = $( '.overlay-show' ),
|
||||
overlay = $( 'div.ult-overlay' ),
|
||||
closeBttn = overlay.find( 'div.ult-overlay-close' );
|
||||
transEndEventNames = {
|
||||
'WebkitTransition': 'webkitTransitionEnd',
|
||||
'MozTransition': 'transitionend',
|
||||
'OTransition': 'oTransitionEnd',
|
||||
'msTransition': 'MSTransitionEnd',
|
||||
'transition': 'transitionend'
|
||||
},
|
||||
transEndEventName = transEndEventNames[ bsfmodernizr.prefixed( 'transition' ) ],
|
||||
support = { transitions : bsfmodernizr.csstransitions };
|
||||
function toggleOverlay(id) {
|
||||
var ovv = 'div.ult-overlay.'+id;
|
||||
joverlay = document.querySelector( ovv );
|
||||
overlay = $(ovv);
|
||||
/* firefox transition issue fix of overflow hidden */
|
||||
|
||||
if( overlay.hasClass('ult-open') ) {
|
||||
overlay.removeClass('ult-open');
|
||||
overlay.addClass('ult-close');
|
||||
//classie.remove( overlay, 'ult-open' );
|
||||
//classie.add( overlay, 'ult-close' );
|
||||
var onEndTransitionFn = function( ev ) {
|
||||
if( support.transitions ) {
|
||||
if( ev.propertyName !== 'visibility' ) return;
|
||||
this.removeEventListener( transEndEventName, onEndTransitionFn );
|
||||
}
|
||||
overlay.removeClass('ult-close');
|
||||
//classie.remove( overlay, 'ult-close' );
|
||||
};
|
||||
if( support.transitions ) {
|
||||
joverlay.addEventListener( transEndEventName, onEndTransitionFn );
|
||||
overlay.removeClass('ult-close');
|
||||
if(window_height < modal_height) //remove overflow hidden
|
||||
$('html').css({'overflow':'auto'});
|
||||
}
|
||||
else {
|
||||
onEndTransitionFn();
|
||||
}
|
||||
}
|
||||
else if( ! overlay.hasClass('ult-close') ) {
|
||||
overlay.addClass('ult-open');
|
||||
//classie.add( overlay, 'ult-open' );
|
||||
}
|
||||
var modal_height = overlay.find('.ult_modal').outerHeight(); //modal height
|
||||
var window_height = $(window).outerHeight(); //window height
|
||||
if(window_height < modal_height) //if window height is less than modal height
|
||||
$('html').css({'overflow':'hidden'}); //add overflow hidden to html
|
||||
}
|
||||
var corner_to = $('.overlay-show-cornershape').find('path').attr('d');
|
||||
function overlay_cornershape_f(id){
|
||||
var ovv = 'div.overlay-cornershape.'+id;
|
||||
var joverlay_cornershape = document.querySelector( ovv );
|
||||
var overlay_cornershape = $(ovv);
|
||||
var s = Snap( joverlay_cornershape.querySelector( 'svg' ) ),
|
||||
path = s.select( 'path' ),
|
||||
pathConfig = {
|
||||
from : 'm 0,0 1439.999975,0 0,805.99999 0,-805.99999 z ',
|
||||
to : ' m 0,0 1439.999975,0 0,805.99999 -1439.999975,0 z '
|
||||
};
|
||||
//var overlay_cornershape = document.querySelector( 'div.overlay-cornershape' );
|
||||
if( overlay_cornershape.hasClass('ult-open') ) {
|
||||
overlay_cornershape.removeClass('ult-open');
|
||||
overlay_cornershape.addClass('ult-close');
|
||||
//classie.remove( overlay_cornershape, 'ult-open' );
|
||||
//classie.add( overlay_cornershape, 'ult-close' );
|
||||
var onEndTransitionFn = function( ev ) {
|
||||
overlay_cornershape.removeClass('ult-close');
|
||||
//classie.remove( overlay_cornershape, 'ult-close' );
|
||||
};
|
||||
path.animate( { 'path' : pathConfig.from }, 400, mina.linear, onEndTransitionFn );
|
||||
}
|
||||
else if( ! overlay_cornershape.hasClass('ult-close') ) {
|
||||
overlay_cornershape.addClass('ult-open');
|
||||
//classie.add( overlay_cornershape, 'ult-open' );
|
||||
path.animate( { 'path' : pathConfig.to }, 400, mina.linear );
|
||||
}
|
||||
}
|
||||
function overlay_genie_f(id) {
|
||||
var ovv = 'div.overlay-genie.'+id;
|
||||
var joverlay_genie = document.querySelector( ovv );
|
||||
var overlay_genie = $(ovv);
|
||||
var gs = Snap( joverlay_genie.querySelector( 'svg' ) ),
|
||||
geniepath = gs.select( 'path' ),
|
||||
steps = joverlay_genie.getAttribute( 'data-steps' ).split(';'),
|
||||
stepsTotal = steps.length;
|
||||
if( overlay_genie.hasClass('ult-open') ) {
|
||||
var pos = stepsTotal-1;
|
||||
overlay_genie.removeClass('ult-open');
|
||||
overlay_genie.addClass('ult-close');
|
||||
//classie.remove( joverlay_genie, 'ult-open' );
|
||||
//classie.add( joverlay_genie, 'ult-close' );
|
||||
var onEndTransitionFn = function( ev ) {
|
||||
overlay_genie.removeClass('ult-close');
|
||||
},
|
||||
nextStep = function( pos ) {
|
||||
pos--;
|
||||
if( pos < 0 ) return;
|
||||
geniepath.animate( { 'path' : steps[pos] }, 60, mina.linear, function() {
|
||||
if( pos === 0 ) {
|
||||
onEndTransitionFn();
|
||||
}
|
||||
nextStep(pos);
|
||||
} );
|
||||
};
|
||||
nextStep(pos);
|
||||
}
|
||||
else if( !overlay_genie.hasClass('ult-close') ) {
|
||||
var pos = 0;
|
||||
overlay_genie.addClass('ult-open');
|
||||
//classie.add( joverlay_genie, 'ult-open' );
|
||||
var nextStep = function( pos ) {
|
||||
pos++;
|
||||
if( pos > stepsTotal - 1 ) return;
|
||||
geniepath.animate( { 'path' : steps[pos] }, 60, mina.linear, function() { nextStep(pos); } );
|
||||
};
|
||||
nextStep(pos);
|
||||
}
|
||||
}
|
||||
function shuffle_overlay_box(array) {
|
||||
var currentIndex = array.length
|
||||
, temporaryValue
|
||||
, randomIndex
|
||||
;
|
||||
// While there remain elements to shuffle...
|
||||
while (0 !== currentIndex) {
|
||||
// Pick a remaining element...
|
||||
randomIndex = Math.floor(Math.random() * currentIndex);
|
||||
currentIndex -= 1;
|
||||
// And swap it with the current element.
|
||||
temporaryValue = array[currentIndex];
|
||||
array[currentIndex] = array[randomIndex];
|
||||
array[randomIndex] = temporaryValue;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
function overlay_boxes_f(id) {
|
||||
var ovv = 'div.overlay-boxes.'+id;
|
||||
var joverlay_boxes = document.querySelector( ovv );
|
||||
var overlay_boxes = $(ovv);
|
||||
var boxes_path = [].slice.call( joverlay_boxes.querySelectorAll( 'svg > path' ) ),
|
||||
pathsTotal = boxes_path.length;
|
||||
var cnt = 0;
|
||||
shuffle_overlay_box( boxes_path );
|
||||
if( overlay_boxes.hasClass('ult-open') ) {
|
||||
overlay_boxes.removeClass('ult-open');
|
||||
overlay_boxes.addClass('ult-close');
|
||||
//classie.remove( joverlay_boxes, 'ult-open' );
|
||||
//classie.add( joverlay_boxes, 'ult-close' );
|
||||
boxes_path.forEach( function( p, i ) {
|
||||
setTimeout( function() {
|
||||
++cnt;
|
||||
p.style.display = 'none';
|
||||
if( cnt === pathsTotal ) {
|
||||
overlay_boxes.removeClass('ult-close');
|
||||
//classie.remove( joverlay_boxes, 'ult-close' );
|
||||
}
|
||||
}, i * 30 );
|
||||
});
|
||||
}
|
||||
else if( !overlay_boxes.hasClass('ult-close') ) {
|
||||
overlay_boxes.addClass('ult-open');
|
||||
//classie.add( joverlay_boxes, 'ult-open' );
|
||||
boxes_path.forEach( function( p, i ) {
|
||||
setTimeout( function() {
|
||||
p.style.display = 'block';
|
||||
}, i * 30 );
|
||||
});
|
||||
}
|
||||
}
|
||||
$(window).load(function(){
|
||||
var onload_modal_array = new Array();
|
||||
$('.ult-onload').each(function(index){
|
||||
onload_modal_array.push($(this));
|
||||
setTimeout(function() {
|
||||
onload_modal_array[index].trigger('click');
|
||||
}, parseInt($(this).data('onload-delay'))*1000);
|
||||
});
|
||||
$('.ult-vimeo iframe').each(function(index, element) {
|
||||
var player_id = $(this).attr('id');
|
||||
var iframe = $(this)[0],
|
||||
player = $f(iframe);
|
||||
player.addEvent('ready', function() {
|
||||
player.addEvent('pause');
|
||||
player.addEvent('finish');
|
||||
});
|
||||
});
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$('.ult-overlay').each(function(){
|
||||
$(this).appendTo(document.body);
|
||||
});
|
||||
$('.ult-overlay').show();
|
||||
$('.overlay-show').each(function(index, element) {
|
||||
var class_id = $(this).data('class-id');
|
||||
$('.'+class_id).find('.ult-vimeo iframe').attr('id','video_'+class_id);
|
||||
$('.'+class_id).find('.ult-youtube iframe').attr('id','video_'+class_id);
|
||||
});
|
||||
var modal_count=0;
|
||||
$(document).on('click', '.overlay-show', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
var class_id = $(this).data('class-id');
|
||||
if($(this).parent().hasClass('modal-hide-mobile') != true && $(this).parent().hasClass('modal-hide-tablet') != true ) {
|
||||
$('.'+class_id).find('.ult_modal-content').removeClass('ult-hide');
|
||||
$('.'+class_id).find('.ult-vimeo iframe').html($('.ult-vimeo iframe').html());
|
||||
$('.'+class_id).addClass($(this).data('overlay-class'));
|
||||
setTimeout(function() {
|
||||
$('body, html').addClass('ult_modal-body-open');
|
||||
toggleOverlay(class_id);
|
||||
content_check(class_id);
|
||||
}, 500);
|
||||
|
||||
if ($(this).parent().attr('data-keypress-control') == 'keypress-control-enable' || $(this).attr('data-keypress-control') == 'keypress-control-enable'){
|
||||
window.onkeydown = function( e ) {
|
||||
if (e.keyCode == 27) {
|
||||
$(document).find('.ult-overlay.ult-open.'+class_id).removeClass('ult-open');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.overlay-show-cornershape', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
var class_id = $(this).data('class-id');
|
||||
$('.'+class_id).find('.ult_modal-content').removeClass('ult-hide');
|
||||
//$('.overlay-cornershape').removeClass('overlay-cornershape');
|
||||
setTimeout(function(){
|
||||
$('.'+class_id).addClass('overlay-cornershape');
|
||||
overlay_cornershape_f(class_id);
|
||||
$('body, html').addClass('ult_modal-body-open');
|
||||
content_check(class_id);
|
||||
},300);
|
||||
});
|
||||
|
||||
$(document).on('click', 'div.overlay-cornershape div.ult-overlay-close', function(event){
|
||||
event.stopPropagation();
|
||||
var class_id = $(this).parents('div.overlay-cornershape').data('class');
|
||||
overlay_cornershape_f(class_id);
|
||||
$('body, html').removeClass('ult_modal-body-open');
|
||||
$('html').css({'overflow':'auto'});
|
||||
$(document).trigger('onUVCModalPopUpClosed',class_id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.overlay-show-boxes', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
var class_id = $(this).data('class-id');
|
||||
$('.'+class_id).find('.ult_modal-content').removeClass('ult-hide');
|
||||
setTimeout(function(){
|
||||
$('.'+class_id).addClass('overlay-boxes');
|
||||
overlay_boxes_f(class_id);
|
||||
$('body, html').addClass('ult_modal-body-open');
|
||||
content_check(class_id);
|
||||
},300);
|
||||
//$('.overlay-boxes').removeClass('overlay-boxes');
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', 'div.overlay-boxes div.ult-overlay-close', function(event){
|
||||
event.stopPropagation();
|
||||
var class_id = $(this).parents('div.overlay-boxes').data('class');
|
||||
overlay_boxes_f(class_id);
|
||||
$('body, html').removeClass('ult_modal-body-open');
|
||||
$('html').css({'overflow':'auto'});
|
||||
$(document).trigger('onUVCModalPopUpClosed',class_id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.overlay-show-genie', function(event){
|
||||
event.preventDefault();
|
||||
|
||||
var class_id = $(this).data('class-id');
|
||||
$('.'+class_id).find('.ult_modal-content').removeClass('ult-hide');
|
||||
//$('.overlay-genie').removeClass('overlay-genie');
|
||||
setTimeout(function(){
|
||||
$('.'+class_id).addClass('overlay-genie');
|
||||
overlay_genie_f(class_id);
|
||||
$('body, html').addClass('ult_modal-body-open');
|
||||
content_check(class_id);
|
||||
$('html').css({'overflow':'auto'});
|
||||
},300);
|
||||
});
|
||||
|
||||
$(document).on('click', 'div.overlay-genie div.ult-overlay-close', function(event){
|
||||
event.stopPropagation();
|
||||
var class_id = $(this).parents('div.overlay-genie').data('class');
|
||||
overlay_genie_f(class_id);
|
||||
$('body, html').removeClass('ult_modal-body-open');
|
||||
$('html').css({'overflow':'auto'});
|
||||
$(document).trigger('onUVCModalPopUpClosed',class_id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.ult-overlay .ult-overlay-close', function(event){
|
||||
event.stopPropagation();
|
||||
$this = $(this);
|
||||
var id = $this.parents('.ult-overlay').data('class');
|
||||
toggleOverlay(id);
|
||||
|
||||
$('body, html').removeClass('ult_modal-body-open');
|
||||
|
||||
if($this.parent().find(".ult-vimeo").length){
|
||||
|
||||
$this.parent().find(".ult-vimeo iframe").each(function(i,iframe){
|
||||
var player_id = $(iframe);
|
||||
var src = $(iframe).attr("src");
|
||||
$(iframe).attr("src",'');
|
||||
$(iframe).attr("src",src);
|
||||
var iframe = player_id[0],
|
||||
player = $f(iframe);
|
||||
player.api('pause');
|
||||
});
|
||||
}
|
||||
|
||||
if ( $this.parent().find(".ult-youtube").length ) {
|
||||
|
||||
$this.parent().find(".ult-youtube iframe").each(function(i,iframe){
|
||||
var src = $(iframe).attr("src");
|
||||
$(iframe).attr("src",'');
|
||||
$(iframe).attr("src",src);
|
||||
});
|
||||
}
|
||||
|
||||
if ( $this.parent().find(".ult-video-shortcode").length ) {
|
||||
|
||||
$this.parent().find(".ult-video-shortcode video").each(function(i,video){
|
||||
video.pause();
|
||||
});
|
||||
}
|
||||
|
||||
$('html').css({'overflow':'auto'});
|
||||
$(document).trigger('onUVCModalPopUpClosed');
|
||||
});
|
||||
|
||||
$(document).on('click', '.ult-overlay .ult_modal', function(event){
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$(document).on('click', '.ult-overlay', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
$this = $(this);
|
||||
var id = $this.data('class');
|
||||
var a = $(document).find('.ult-modal-input-wrapper').children();
|
||||
a.each(function () {
|
||||
var class_id = $(this).data('class-id'); // "this" is the current element in the loop
|
||||
if( class_id == id && $(this).parent('.ult-modal-input-wrapper').data('overlay-control') == 'overlay-control-enable' ) {
|
||||
$this.find('.ult-overlay-close').trigger('click');
|
||||
$('html').css({'overflow':'auto'});
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
function content_check(id){
|
||||
var ch = $('.'+id).find('.ult_modal-content').height();
|
||||
var wh = $(window).height();
|
||||
if(ch>wh){
|
||||
$('.'+id).addClass('ult_modal-auto-top');
|
||||
}
|
||||
else{
|
||||
$('.'+id).removeClass('ult_modal-auto-top');
|
||||
}
|
||||
if($('.'+id).find('iframe').length > 0)
|
||||
{
|
||||
$('.'+id).find('iframe').each(function(i,iframe){
|
||||
$(iframe).attr('src', $(iframe).attr('src'));
|
||||
});
|
||||
}
|
||||
$( document ).trigger( "onUVCModalPopupOpen", id );
|
||||
}
|
||||
|
||||
function resize_modal_iframe()
|
||||
{
|
||||
$(".ult_modal-body iframe").each(function(index, element) {
|
||||
var w = $(this).parent().width();
|
||||
var small_modal = ($(this).parent().parent().parent().hasClass('ult-small')) ? true : false;
|
||||
var medium_modal = ($(this).parent().parent().parent().hasClass('ult-medium')) ? true : false;
|
||||
var large_modal = ($(this).parent().parent().parent().hasClass('ult-container')) ? true : false;
|
||||
var block_modal = ($(this).parent().parent().parent().hasClass('ult-block')) ? true : false;
|
||||
|
||||
var c = w/10;
|
||||
var h = (w*(9/16))+c;
|
||||
|
||||
var is_video = ($(this).parent().hasClass('ult-youtube') || $(this).parent().hasClass('ult-vimeo')) ? true : false;
|
||||
if(!is_video)
|
||||
return false;
|
||||
|
||||
if(large_modal)
|
||||
{
|
||||
var window_height = $(window).height();
|
||||
if(window_height < h)
|
||||
h = window_height - 100;
|
||||
}
|
||||
|
||||
if(block_modal)
|
||||
{
|
||||
w = $(this).attr('width')
|
||||
h = $(this).attr('height');
|
||||
if( typeof w === 'undefined' || w == '')
|
||||
w = 640;
|
||||
if( typeof h === 'undefined' || h == '')
|
||||
h = 360;
|
||||
}
|
||||
|
||||
$(this).css({"width":w+"px","height":h+"px"});
|
||||
});
|
||||
}
|
||||
$(document).on('onUVCModalPopupOpen',function(){
|
||||
resize_modal_iframe();
|
||||
$(window).trigger('resize');
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1 @@
|
||||
/* bsfmodernizr 2.7.1 (Custom Build) | MIT & BSD
* Build: http://bsfmodernizr.com/download/#-csstransitions-shiv-cssclasses-prefixed-testprop-testallprops-domprefixes-load
*/
;window.bsfmodernizr=function(a,b,c){function x(a){j.cssText=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a){var e=a[d];if(!A(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+n.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+o.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.7.1",e={},f=!0,g=b.documentElement,h="bsfmodernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m="Webkit Moz O ms",n=m.split(" "),o=m.toLowerCase().split(" "),p={},q={},r={},s=[],t=s.slice,u,v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=t.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(t.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e}),p.csstransitions=function(){return D("transition")};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._domPrefixes=o,e._cssomPrefixes=n,e.testProp=function(a){return B([a])},e.testAllProps=D,e.prefixed=function(a,b,c){return b?D(a,b,c):D(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+s.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=nuLine truncated
|
||||
@@ -0,0 +1,180 @@
|
||||
/*!
|
||||
* jQuery UI Touch Punch 0.2.3
|
||||
*
|
||||
* Copyright 2011–2014, Dave Furfero
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.mouse.js
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
// Detect touch support
|
||||
$.support.touch = 'ontouchend' in document;
|
||||
|
||||
// Ignore browsers without touch support
|
||||
if (!$.support.touch) {
|
||||
return;
|
||||
}
|
||||
|
||||
var mouseProto = $.ui.mouse.prototype,
|
||||
_mouseInit = mouseProto._mouseInit,
|
||||
_mouseDestroy = mouseProto._mouseDestroy,
|
||||
touchHandled;
|
||||
|
||||
/**
|
||||
* Simulate a mouse event based on a corresponding touch event
|
||||
* @param {Object} event A touch event
|
||||
* @param {String} simulatedType The corresponding mouse event
|
||||
*/
|
||||
function simulateMouseEvent (event, simulatedType) {
|
||||
|
||||
// Ignore multi-touch events
|
||||
if (event.originalEvent.touches.length > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var touch = event.originalEvent.changedTouches[0],
|
||||
simulatedEvent = document.createEvent('MouseEvents');
|
||||
|
||||
// Initialize the simulated mouse event using the touch event's coordinates
|
||||
simulatedEvent.initMouseEvent(
|
||||
simulatedType, // type
|
||||
true, // bubbles
|
||||
true, // cancelable
|
||||
window, // view
|
||||
1, // detail
|
||||
touch.screenX, // screenX
|
||||
touch.screenY, // screenY
|
||||
touch.clientX, // clientX
|
||||
touch.clientY, // clientY
|
||||
false, // ctrlKey
|
||||
false, // altKey
|
||||
false, // shiftKey
|
||||
false, // metaKey
|
||||
0, // button
|
||||
null // relatedTarget
|
||||
);
|
||||
|
||||
// Dispatch the simulated event to the target element
|
||||
event.target.dispatchEvent(simulatedEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the jQuery UI widget's touchstart events
|
||||
* @param {Object} event The widget element's touchstart event
|
||||
*/
|
||||
mouseProto._touchStart = function (event) {
|
||||
|
||||
var self = this;
|
||||
|
||||
// Ignore the event if another widget is already being handled
|
||||
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the flag to prevent other widgets from inheriting the touch event
|
||||
touchHandled = true;
|
||||
|
||||
// Track movement to determine if interaction was a click
|
||||
self._touchMoved = false;
|
||||
|
||||
// Simulate the mouseover event
|
||||
simulateMouseEvent(event, 'mouseover');
|
||||
|
||||
// Simulate the mousemove event
|
||||
simulateMouseEvent(event, 'mousemove');
|
||||
|
||||
// Simulate the mousedown event
|
||||
simulateMouseEvent(event, 'mousedown');
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle the jQuery UI widget's touchmove events
|
||||
* @param {Object} event The document's touchmove event
|
||||
*/
|
||||
mouseProto._touchMove = function (event) {
|
||||
|
||||
// Ignore event if not handled
|
||||
if (!touchHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Interaction was not a click
|
||||
this._touchMoved = true;
|
||||
|
||||
// Simulate the mousemove event
|
||||
simulateMouseEvent(event, 'mousemove');
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle the jQuery UI widget's touchend events
|
||||
* @param {Object} event The document's touchend event
|
||||
*/
|
||||
mouseProto._touchEnd = function (event) {
|
||||
|
||||
// Ignore event if not handled
|
||||
if (!touchHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Simulate the mouseup event
|
||||
simulateMouseEvent(event, 'mouseup');
|
||||
|
||||
// Simulate the mouseout event
|
||||
simulateMouseEvent(event, 'mouseout');
|
||||
|
||||
// If the touch interaction did not move, it should trigger a click
|
||||
if (!this._touchMoved) {
|
||||
|
||||
// Simulate the click event
|
||||
simulateMouseEvent(event, 'click');
|
||||
}
|
||||
|
||||
// Unset the flag to allow other widgets to inherit the touch event
|
||||
touchHandled = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
|
||||
* This method extends the widget with bound touch event handlers that
|
||||
* translate touch events to mouse events and pass them to the widget's
|
||||
* original mouse event handling methods.
|
||||
*/
|
||||
mouseProto._mouseInit = function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
// Delegate the touch handlers to the widget's element
|
||||
self.element.bind({
|
||||
touchstart: $.proxy(self, '_touchStart'),
|
||||
touchmove: $.proxy(self, '_touchMove'),
|
||||
touchend: $.proxy(self, '_touchEnd')
|
||||
});
|
||||
|
||||
// Call the original $.ui.mouse init method
|
||||
_mouseInit.call(self);
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove the touch event handlers
|
||||
*/
|
||||
mouseProto._mouseDestroy = function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
// Delegate the touch handlers to the widget's element
|
||||
self.element.unbind({
|
||||
touchstart: $.proxy(self, '_touchStart'),
|
||||
touchmove: $.proxy(self, '_touchMove'),
|
||||
touchend: $.proxy(self, '_touchEnd')
|
||||
});
|
||||
|
||||
// Call the original $.ui.mouse destroy method
|
||||
_mouseDestroy.call(self);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,312 @@
|
||||
/*range-slider js*/
|
||||
|
||||
jQuery(document).ready(function( $ ) {
|
||||
|
||||
//////// Lighter darker script //////////
|
||||
|
||||
/****************** How To Use ***************
|
||||
|
||||
wp_enqueue_script( 'bsf-color-gradient' );
|
||||
|
||||
var hex = '#ffa039';
|
||||
var rgb = 'rgb(255, 153, 0)';
|
||||
var rgba = 'rgba(255, 153, 0, 0.3)';
|
||||
|
||||
|
||||
// Convert colors
|
||||
|
||||
var hex_light = lighterColor( hex , .2); // Here .2 is ratio
|
||||
var hex_dark = darkerColor( hex , .2);
|
||||
|
||||
var rgb_light = lighterColor( rgb , .2);
|
||||
var rgb_dark = darkerColor( rgb , .2);
|
||||
|
||||
var rgba_light = lighterColor( rgba , .2);
|
||||
var rgba_dark = darkerColor( rgba , .2);
|
||||
|
||||
**********************************************/
|
||||
|
||||
/* Helper function */
|
||||
var pad = function(num, totalChars) {
|
||||
var pad = '0';
|
||||
num = num + '';
|
||||
while (num.length < totalChars) {
|
||||
num = pad + num;
|
||||
}
|
||||
return num;
|
||||
};
|
||||
|
||||
// Ratio is between 0 and 1
|
||||
var changeColor = function(color, ratio, darker) {
|
||||
// Trim trailing/leading whitespace
|
||||
color = color.replace(/^\s*|\s*$/, '');
|
||||
|
||||
// Expand three-digit hex
|
||||
color = color.replace(
|
||||
/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,
|
||||
'#$1$1$2$2$3$3'
|
||||
);
|
||||
|
||||
// Calculate ratio
|
||||
var difference = Math.round(ratio * 256) * (darker ? -1 : 1),
|
||||
// Determine if input is RGB(A)
|
||||
rgb = color.match(new RegExp('^rgba?\\(\\s*' +
|
||||
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
||||
'\\s*,\\s*' +
|
||||
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
||||
'\\s*,\\s*' +
|
||||
'(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])' +
|
||||
'(?:\\s*,\\s*' +
|
||||
'(0|1|0?\\.\\d+))?' +
|
||||
'\\s*\\)$'
|
||||
, 'i')),
|
||||
alpha = !!rgb && rgb[4] != null ? rgb[4] : null,
|
||||
|
||||
// Convert hex to decimal
|
||||
decimal = !!rgb? [rgb[1], rgb[2], rgb[3]] : color.replace(
|
||||
/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,
|
||||
function() {
|
||||
return parseInt(arguments[1], 16) + ',' +
|
||||
parseInt(arguments[2], 16) + ',' +
|
||||
parseInt(arguments[3], 16);
|
||||
}
|
||||
).split(/,/),
|
||||
returnValue;
|
||||
|
||||
// Return RGB(A)
|
||||
return !!rgb ?
|
||||
'rgb' + (alpha !== null ? 'a' : '') + '(' +
|
||||
Math[darker ? 'max' : 'min'](
|
||||
parseInt(decimal[0], 10) + difference, darker ? 0 : 255
|
||||
) + ', ' +
|
||||
Math[darker ? 'max' : 'min'](
|
||||
parseInt(decimal[1], 10) + difference, darker ? 0 : 255
|
||||
) + ', ' +
|
||||
Math[darker ? 'max' : 'min'](
|
||||
parseInt(decimal[2], 10) + difference, darker ? 0 : 255
|
||||
) +
|
||||
(alpha !== null ? ', ' + alpha : '') +
|
||||
')' :
|
||||
// Return hex
|
||||
[
|
||||
'#',
|
||||
pad(Math[darker ? 'max' : 'min'](
|
||||
parseInt(decimal[0], 10) + difference, darker ? 0 : 255
|
||||
).toString(16), 2),
|
||||
pad(Math[darker ? 'max' : 'min'](
|
||||
parseInt(decimal[1], 10) + difference, darker ? 0 : 255
|
||||
).toString(16), 2),
|
||||
pad(Math[darker ? 'max' : 'min'](
|
||||
parseInt(decimal[2], 10) + difference, darker ? 0 : 255
|
||||
).toString(16), 2)
|
||||
].join('');
|
||||
};
|
||||
var lighterColor = function(color, ratio) {
|
||||
return changeColor(color, ratio, false);
|
||||
};
|
||||
var darkerColor = function(color, ratio) {
|
||||
return changeColor(color, ratio, true);
|
||||
};
|
||||
|
||||
/////////// End lighter darker script /////////////////////////////
|
||||
|
||||
var range_slider = $('.ult-rs-wrapper');//$('.ult-rslider-container');
|
||||
count = 0;
|
||||
|
||||
range_slider.each(function() {
|
||||
count = count +1;
|
||||
var title_width = 0,
|
||||
title_height = 0,
|
||||
desc_height = 0;
|
||||
|
||||
|
||||
var $this = $(this).find('.ult-rslider-container');
|
||||
var rs_create = 0;
|
||||
//alert($this);
|
||||
var slider_steps = $this.data('slider_steps');
|
||||
var slider_color = $this.data('slider_color');
|
||||
|
||||
slider_color = ( !slider_color) ? '#3BF7D1' : slider_color
|
||||
var hex = slider_color;
|
||||
// Convert colors
|
||||
var hex_light = lighterColor( hex , .2);
|
||||
var hex_dark = darkerColor( hex , .2);
|
||||
|
||||
var slider_active_color = hex_dark ,
|
||||
dragger_color = hex_dark;
|
||||
|
||||
var title_background = $this.data('title-background');
|
||||
var title_box = $this.data('title-box');
|
||||
|
||||
var slider_size = $this.data('slider_size');
|
||||
var adaptive_height = $this.data('adaptive_height');
|
||||
//dragger_size = $this.data('dragger_size');
|
||||
|
||||
var arrow_style = $this.data('arrow');
|
||||
var arrow_background = 'border-top-color:'+title_background+';';
|
||||
if( arrow_style ){
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = '.ult-arrow'+ count +':before { '+ arrow_style +' }' + '.ult-arrow'+ count +':after { '+ arrow_background +' }';
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
var arrow_class = 'ult-arrow'+ count;
|
||||
$this.find('.ult-arrow').addClass( arrow_class );
|
||||
//alert();
|
||||
}
|
||||
var slider_container = $this;
|
||||
var slider_wrapper = $(this);
|
||||
var ult_slider = $this.find('.ult-rslider');
|
||||
|
||||
var tooltip = "";
|
||||
|
||||
var slider_function = function(event, ui) {
|
||||
|
||||
var ult_handle = $this.find('.ui-slider-handle');
|
||||
|
||||
var value = ui.value || 1 ;
|
||||
//alert(value);
|
||||
//var title_class_pre = ".ult-title"+ (parseInt(value) - 1);
|
||||
//var title_class_next = ".ult-title"+ (parseInt(value) + 1);
|
||||
var title_class = ".ult-title"+ value;
|
||||
|
||||
//var desc_class_pre = ".ult-desc"+ (parseInt(value) - 1);
|
||||
//var desc_class_next = ".ult-desc"+ (parseInt(value) + 1);
|
||||
var desc_class = ".ult-desc"+ value;
|
||||
|
||||
/* alert(r_class_pre);
|
||||
alert(r_class);
|
||||
alert(r_class_next);*/
|
||||
|
||||
|
||||
if( !slider_container.find('.ult-tooltip').hasClass("ult-done") ){
|
||||
slider_container.find('.ult-tooltip').each(function (index) {
|
||||
$(this).addClass("ult-done");
|
||||
ult_handle.append($(this));
|
||||
})
|
||||
rs_create = 1;
|
||||
}
|
||||
|
||||
slider_container.find( title_class ).css( "visibility", "visible" );
|
||||
slider_container.find( title_class ).siblings().css( "visibility", "hidden" );
|
||||
|
||||
slider_wrapper.find( desc_class ).css( 'display', 'block' );
|
||||
slider_wrapper.find( desc_class ).siblings().css( "display", "none" );
|
||||
|
||||
ticks_slide (value);//, slider_container, slider_active_color, slider_color);
|
||||
}
|
||||
|
||||
|
||||
function ticks_slide (value){//(value, slider_container, slider_active_color, slider_color) {
|
||||
|
||||
//var ult_slider_ticks_pre = '.ult-slider-ticks'+(value-1);
|
||||
var ult_slider_ticks = '.ult-slider-ticks'+value;
|
||||
//var ult_slider_ticks_next = '.ult-slider-ticks'+(value+1);
|
||||
|
||||
//var ult_ticks_pre = slider_container.find(ult_slider_ticks_pre);
|
||||
var ult_ticks = slider_container.find(ult_slider_ticks);
|
||||
//var ult_ticks_next = slider_container.find(ult_slider_ticks_next);
|
||||
|
||||
//alert(ult_ticks_next);
|
||||
//console.log(ult_ticks);
|
||||
/* console.log(slider_active_color);
|
||||
|
||||
|
||||
ult_ticks_pre.css('background', slider_active_color);
|
||||
ult_ticks.css('background', slider_color);
|
||||
ult_ticks_next.css('background', slider_color);*/
|
||||
|
||||
//ult_ticks.css('background-color', slider_active_color);
|
||||
//ult_ticks.css('background', slider_color);
|
||||
ult_ticks.prevAll('.ui-slider-label-ticks').css( "background", slider_active_color );
|
||||
ult_ticks.nextAll('.ui-slider-label-ticks').css( "background", slider_color );
|
||||
|
||||
|
||||
}
|
||||
|
||||
//jquery ui slider
|
||||
ult_slider.slider({
|
||||
range: "min",
|
||||
min: 1,
|
||||
max: slider_steps,
|
||||
step: 1,
|
||||
create: slider_function,
|
||||
slide: slider_function,
|
||||
});
|
||||
|
||||
|
||||
//ticks on slider
|
||||
ult_slider.labeledslider({
|
||||
max: slider_steps-1,
|
||||
tickInterval: 1
|
||||
});
|
||||
|
||||
if(title_box == 'auto'){
|
||||
$this.find('.ult-tooltip').each(function (){
|
||||
var temp_w = $(this).outerWidth();
|
||||
var temp_h = $(this).outerHeight();
|
||||
temp_w = (temp_w/2) + 10; // half size as a padding
|
||||
title_width = ( title_width > temp_w ) ? title_width : temp_w;
|
||||
title_height = ( title_height > temp_h ) ? title_height : temp_h;
|
||||
});
|
||||
|
||||
var padding_all = title_height+'px '+title_width+'px 35px';
|
||||
$this.css( "padding", padding_all );
|
||||
}
|
||||
|
||||
if (adaptive_height == 'on') {
|
||||
slider_wrapper.find('.ult-description').each(function (){
|
||||
var temp_h = $(this).outerHeight();
|
||||
desc_height = ( desc_height > temp_h ) ? desc_height : temp_h;
|
||||
});
|
||||
|
||||
desc_height = (desc_height+30)+'px';
|
||||
slider_wrapper.find('.ult-desc-wrap').css( "min-height", desc_height );
|
||||
};
|
||||
|
||||
$this.find(".ui-slider-labels" ).children(".ui-slider-label-ticks").css( "background", slider_color );
|
||||
//alert(slider_color);
|
||||
/*if( !dragger_size ){
|
||||
dragger_size = '';
|
||||
}*/
|
||||
var custom_css = {};
|
||||
//var dragger_width = 'width',
|
||||
// dragger_height = 'height',
|
||||
var dragger_background = 'background';
|
||||
|
||||
// custom_css[dragger_width] = dragger_size;
|
||||
// custom_css[dragger_height] = dragger_size;
|
||||
custom_css[dragger_background] = dragger_color;
|
||||
|
||||
|
||||
var dragger = ult_slider.find('.ui-slider-handle');
|
||||
ult_slider.css( 'background', slider_color );
|
||||
dragger.css( custom_css );
|
||||
ult_slider.find('.ui-slider-range').css( 'background', slider_active_color );
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*var initialValue = 1955;
|
||||
|
||||
var sliderTooltip = function(event, ui) {
|
||||
var curValue = ui.value || initialValue;
|
||||
var tooltip = '<div class="tooltip"><div class="tooltip-inner">' + curValue + '</div><div class="tooltip-arrow"></div></div>';
|
||||
|
||||
$('.ui-slider-handle').html(tooltip);
|
||||
|
||||
}
|
||||
|
||||
$("#slider").slider({
|
||||
|
||||
|
||||
min: 1955,
|
||||
max: 2015,
|
||||
value: initialValue,
|
||||
step: 10,
|
||||
create: sliderTooltip,
|
||||
slide: sliderTooltip
|
||||
});*/
|
||||
@@ -0,0 +1,139 @@
|
||||
(function ($) {
|
||||
$(document).ready(function () {
|
||||
$(".ult-carousel-wrapper").each(function () {
|
||||
var $this = $(this);
|
||||
if ($this.hasClass("ult_full_width")) {
|
||||
$this.css('left', 0);
|
||||
$this.css('right', 0);
|
||||
var rtl = $this.attr('data-rtl');
|
||||
var w = $("html").outerWidth();
|
||||
var al = 0;
|
||||
var bl = $this.offset().left;
|
||||
var xl = Math.abs(al - bl);
|
||||
var left = xl;
|
||||
if (rtl === 'true' || rtl === true)
|
||||
$this.css({"position": "relative", "right": "-" + left + "px", "width": w + "px"});
|
||||
else
|
||||
$this.css({"position": "relative", "left": "-" + left + "px", "width": w + "px"});
|
||||
}
|
||||
});
|
||||
$('.ult-carousel-wrapper').each(function (i, carousel) {
|
||||
var gutter = $(carousel).data('gutter');
|
||||
var id = $(carousel).attr('id');
|
||||
if (gutter != '') {
|
||||
var css = '<style>#' + id + ' .slick-slide { margin:0 ' + gutter + 'px; } </style>';
|
||||
$('head').append(css);
|
||||
}
|
||||
});
|
||||
|
||||
$('.ult-carousel-wrapper').on('init', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
$('.ult-carousel-wrapper .ult-item-wrap.slick-active').each(function (index, el) {
|
||||
$this = $(this);
|
||||
$this.addClass($this.data('animation'));
|
||||
});
|
||||
});
|
||||
|
||||
$('.ult-carousel-wrapper').on('beforeChange', function (event, slick, currentSlide) {
|
||||
$inViewPort = $("[data-slick-index='" + currentSlide + "']");
|
||||
$inViewPort.siblings().removeClass($inViewPort.data('animation'));
|
||||
});
|
||||
|
||||
$('.ult-carousel-wrapper').on('afterChange', function (event, slick, currentSlide, nextSlide) {
|
||||
slidesScrolled = slick.options.slidesToScroll;
|
||||
slidesToShow = slick.options.slidesToShow;
|
||||
centerMode = slick.options.centerMode;
|
||||
windowWidth = jQuery( window ).width();
|
||||
if ( windowWidth < 1025 ) {
|
||||
slidesToShow = slick.options.responsive[0].settings.slidesToShow;
|
||||
}
|
||||
if ( windowWidth < 769 ) {
|
||||
slidesToShow = slick.options.responsive[1].settings.slidesToShow;
|
||||
}
|
||||
if ( windowWidth < 481 ) {
|
||||
slidesToShow = slick.options.responsive[2].settings.slidesToShow;
|
||||
}
|
||||
|
||||
$currentParent = slick.$slider[0].parentElement.id;
|
||||
|
||||
slideToAnimate = currentSlide + slidesToShow - 1;
|
||||
|
||||
if (slidesScrolled == 1) {
|
||||
|
||||
if ( centerMode == true ) {
|
||||
animate = slideToAnimate - 2;
|
||||
$inViewPort = $( '#' + $currentParent + " [data-slick-index='" + animate + "']");
|
||||
$inViewPort.addClass($inViewPort.data('animation'));
|
||||
} else {
|
||||
$inViewPort = $( '#' + $currentParent + " [data-slick-index='" + slideToAnimate + "']");
|
||||
$inViewPort.addClass($inViewPort.data('animation'));
|
||||
}
|
||||
} else {
|
||||
|
||||
for (var i = slidesScrolled + currentSlide; i >= 0; i--) {
|
||||
$inViewPort = $( '#' + $currentParent + " [data-slick-index='" + i + "']");
|
||||
$inViewPort.addClass($inViewPort.data('animation'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).resize(function () {
|
||||
$(".ult-carousel-wrapper").each(function () {
|
||||
var $this = $(this);
|
||||
if ($this.hasClass("ult_full_width")) {
|
||||
var rtl = $this.attr('data-rtl');
|
||||
$this.removeAttr("style");
|
||||
var w = $("html").outerWidth();
|
||||
var al = 0;
|
||||
var bl = $this.offset().left;
|
||||
var xl = Math.abs(al - bl);
|
||||
var left = xl;
|
||||
if (rtl === 'true' || rtl === true)
|
||||
$this.css({"position": "relative", "right": "-" + left + "px", "width": w + "px"});
|
||||
else
|
||||
$this.css({"position": "relative", "left": "-" + left + "px", "width": w + "px"});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
$(window).load(function () {
|
||||
$(".ult-carousel-wrapper").each(function () {
|
||||
var $this = $(this);
|
||||
if ($this.hasClass("ult_full_width")) {
|
||||
$this.css('left', 0);
|
||||
$this.css('right', 0);
|
||||
var al = 0;
|
||||
var bl = $this.offset().left;
|
||||
var xl = Math.abs(al - bl);
|
||||
var rtl = $this.attr('data-rtl');
|
||||
var w = $("html").outerWidth();
|
||||
var left = xl;
|
||||
if (rtl === 'true' || rtl === true)
|
||||
$this.css({"position": "relative", "right": "-" + left + "px", "width": w + "px"});
|
||||
else
|
||||
$this.css({"position": "relative", "left": "-" + left + "px", "width": w + "px"});
|
||||
}
|
||||
});
|
||||
});
|
||||
jQuery(document).on('ultAdvancedTabClickedCarousel',function(event, nav){
|
||||
$(nav).find(".ult-carousel-wrapper").each(function () {
|
||||
var $this = $(this);
|
||||
if ($this.hasClass("ult_full_width")) {
|
||||
$this.css('left', 0);
|
||||
$this.css('right', 0);
|
||||
var al = 0;
|
||||
var bl = $this.offset().left;
|
||||
var xl = Math.abs(al - bl);
|
||||
var rtl = $this.attr('data-rtl');
|
||||
var w = $("html").outerWidth();
|
||||
var left = xl;
|
||||
if (rtl === 'true' || rtl === true)
|
||||
$this.css({"position": "relative", "right": "-" + left + "px", "width": w + "px"});
|
||||
else
|
||||
$this.css({"position": "relative", "left": "-" + left + "px", "width": w + "px"});
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
_ _ _ _
|
||||
___| (_) ___| | __ (_)___
|
||||
/ __| | |/ __| |/ / | / __|
|
||||
\__ \ | | (__| < _ | \__ \
|
||||
|___/_|_|\___|_|\_(_)/ |___/
|
||||
|__/
|
||||
|
||||
Version: 1.6.0
|
||||
Author: Ken Wheeler
|
||||
Website: http://kenwheeler.github.io
|
||||
Docs: http://kenwheeler.github.io/slick
|
||||
Repo: http://github.com/kenwheeler/slick
|
||||
Issues: http://github.com/kenwheeler/slick/issues
|
||||
|
||||
*/
|
||||
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a('<button type="button" data-role="none" role="button" tabindex="0" />').text(c+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.focussed=!1,e.interrupted=!1,e.hidden="hidden",e.paused=!0,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,d,f),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0)}var b=0;return c}(),b.prototype.activateADA=function(){var a=this;a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),e.options.vertical===!1?d[e.animType]="translate3d("+b+"px, 0px, 0px)":d[e.animType]="translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.getNavTarget=function(){var b=this,c=b.options.asNavFor;return c&&null!==c&&(Line truncated
|
||||
d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.interrupt=function(a){var b=this;a||b.autoPlay(),b.interrupted=a},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,j,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay&&clearInterval(i.autoPlayTimer),e=0>d?i.slideCount%i.options.slidesToScroll!==0?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?i.slideCount%i.options.slidesToScroll!==0?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.options.asNavFor&&(j=i.getNavTarget(),j=j.slick("getSlick"),j.slideCount<=j.options.slidesToShow&&j.setSlideClasses(i.currentSlide)),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)})):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"down":"up":"vertical"},b.prototype.swipeEnd=function(a){var c,d,b=this;if(b.dragging=!1,b.interrupted=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe){switch(d=b.swipeDirection()){case"left":case"down":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.currentDirection=0;break;case"right":case"up":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.currentDirection=1}"vertical"!=d&&(b.slideHandler(c),b.touchObject={},b.$slider.trigger("swipe",[b,d]))}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swLine truncated
|
||||
@@ -0,0 +1,20 @@
|
||||
// Snap.svg 0.2.0
|
||||
//
|
||||
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// build: 2013-12-23
|
||||
!function(a){var b,c,d="0.4.2",e="hasOwnProperty",f=/[\.\/]/,g="*",h=function(){},i=function(a,b){return a-b},j={n:{}},k=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=k.listeners(a),j=0,l=[],m={},n=[],o=b;b=a,c=0;for(var p=0,q=h.length;q>p;p++)"zIndex"in h[p]&&(l.push(h[p].zIndex),h[p].zIndex<0&&(m[h[p].zIndex]=h[p]));for(l.sort(i);l[j]<0;)if(e=m[l[j++]],n.push(e.apply(d,g)),c)return c=f,n;for(p=0;q>p;p++)if(e=h[p],"zIndex"in e)if(e.zIndex==l[j]){if(n.push(e.apply(d,g)),c)break;do if(j++,e=m[l[j]],e&&n.push(e.apply(d,g)),c)break;while(e)}else m[e.zIndex]=e;else if(n.push(e.apply(d,g)),c)break;return c=f,b=o,n.length?n:null};k._events=j,k.listeners=function(a){var b,c,d,e,h,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,h=m.length;h>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[g]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},k.on=function(a,b){if(a=String(a),"function"!=typeof b)return function(){};for(var c=a.split(f),d=j,e=0,g=c.length;g>e;e++)d=d.n,d=d.hasOwnProperty(c[e])&&d[c[e]]||(d[c[e]]={n:{}});for(d.f=d.f||[],e=0,g=d.f.length;g>e;e++)if(d.f[e]==b)return h;return d.f.push(b),function(a){+a==+a&&(b.zIndex=+a)}},k.f=function(a){var b=[].slice.call(arguments,1);return function(){k.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},k.stop=function(){c=1},k.nt=function(a){return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(b):b},k.nts=function(){return b.split(f)},k.off=k.unbind=function(a,b){if(!a)return k._events=j={n:{}},void 0;var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i=0,l=o.length;l>i;i++)for(m=0;m<p.length;m+=h.length-2){if(h=[m,1],c=p[m].n,o[i]!=g)c[o[i]]&&h.push(c[o[i]]);else for(d in c)c[e](d)&&h.push(c[d]);p.splice.apply(p,h)}for(i=0,l=p.length;l>i;i++)for(c=p[i];c.n;){if(b){if(c.f){for(m=0,n=c.f.length;n>m;m++)if(c.f[m]==b){c.f.splice(m,1);break}!c.f.length&&delete c.f}for(d in c.n)if(c.n[e](d)&&c.n[d].f){var q=c.n[d].f;for(m=0,n=q.length;n>m;m++)if(q[m]==b){q.splice(m,1);break}!q.length&&delete c.n[d].f}}else{delete c.f;for(d in c.n)c.n[e](d)&&c.n[d].f&&delete c.n[d].f}c=c.n}},k.once=function(a,b){var c=function(){return k.unbind(a,c),b.apply(this,arguments)};return k.on(a,c)},k.version=d,k.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=k:"undefined"!=typeof define?define("eve",[],function(){return k}):a.eve=k}(this),function(a,b){"function"==typeof define&&define.amd?define(["eve"],function(c){return b(a,c)}):b(a,a.eve)}(this,function(a,b){var c=function(b){var c={},d=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},e=Array.isArray||function(a){return a instanceof Array||"[object Array]"==Object.prototype.toString.call(a)},f=0,g="M"+(+new Date).toString(36),h=function(){return g+(f++).toString(36)},i=Date.now||function(){return+new Date},j=function(a){var b=this;if(null==a)return b.s;var c=b.s-a;b.b+=b.dur*c,b.B+=b.dur*c,b.s=a},k=function(a){var b=this;return null==a?b.spd:(b.spd=a,void 0)},l=function(a){var b=this;return null==a?b.dur:(b.s=b.s*a/b.dur,b.dur=a,void 0)},m=function(){var a=this;delete c[a.id],b("mina.stop."+a.id,a)},n=function(){var a=this;a.pdif||(delete c[a.id],a.pdif=a.get()-a.b)},o=function(){var a=this;a.pdif&&(a.b=a.get()-a.pdif,delete a.pdif,c[a.id]=a)},p=function(){var a=0;for(var f in c)if(c.hasOwnProperty(f)){var g,h=c[f],i=h.get();if(a++,h.s=(i-h.b)/(h.dur/h.spd),h.s>=1&&(delete c[f],h.s=1,a--,function(a){setTimeout(function(){b("mina.finish."+a.id,a)})}(h)),e(h.start)){g=[];for(var j=0,k=h.start.length;k>j;j++)g[j]=+h.start[j]+(h.end[j]-h.start[j])*h.easing(h.s)}else g=+h.start+(h.end-h.start)*h.easing(h.s);h.set(g)}a&&d(p)},q=function(a,b,e,f,g,i,r){var s={id:h(),start:a,end:b,b:e,s:0,dur:f-e,spd:1,get:g,set:i,easing:r||q.linear,status:j,speed:k,duration:l,stop:m,pause:n,resume:o};c[s.id]=s;var t,u=0;for(t in c)if(c.hasOwnProperty(t)&&(u++,2==u))break;return 1==u&&d(p),s};return q.time=i,q.getById=function(a){return c[a]||null},q.linear=function(a){return a},q.easeout=function(a){return Math.pow(a,1.7)},q.easein=function(a){return Math.pow(a,.48)},q.easeinout=function(a){if(1==a)return 1;if(0==a)return 0;var b=.48-a/1.04,c=Math.sqrt(.1734+b*b),d=c-b,e=Math.pow(Math.abs(d),1/3)*(0>d?-1:1),f=-c-b,g=Math.pow(Math.abs(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},q.backin=function(a){if(1==a)return 1;var b=1.70158;return a*a*((b+1)*a-b)},q.backout=function(a){if(0==a)return 0;a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},q.elastic=function(a){return a==!!a?a:Math.pow(2,-10*a)*Math.sin((a-.075)*2*Math.PI/.3)+1},q.bounce=function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b},a.mina=q,q}("undefined"==typeof b?function(){}:b),d=function(){function d(a,b){if(a){if(a.tagName)return z(a);if(a instanceof uLine truncated
|
||||
return f(a,"object")&&"cx"in a?e.attr(a):null!=a&&e.attr({cx:a,cy:b,rx:c,ry:d}),e},a.path=function(a){var b=x("path",this.node);return f(a,"object")&&!f(a,"array")?b.attr(a):a&&b.attr({d:a}),b},a.group=a.g=function(b){var c=x("g",this.node);c.add=t;for(var d in a)a[J](d)&&(c[d]=a[d]);return 1==arguments.length&&b&&!b.type?c.attr(b):arguments.length&&c.add(Array.prototype.slice.call(arguments,0)),c},a.text=function(a,b,c){var d=x("text",this.node);return f(a,"object")?d.attr(a):null!=a&&d.attr({x:a,y:b,text:c||""}),d},a.line=function(a,b,c,d){var e=x("line",this.node);return f(a,"object")?e.attr(a):null!=a&&e.attr({x1:a,x2:c,y1:b,y2:d}),e},a.polyline=function(a){arguments.length>1&&(a=Array.prototype.slice.call(arguments,0));var b=x("polyline",this.node);return f(a,"object")&&!f(a,"array")?b.attr(a):null!=a&&b.attr({points:a}),b},a.polygon=function(a){arguments.length>1&&(a=Array.prototype.slice.call(arguments,0));var b=x("polygon",this.node);return f(a,"object")&&!f(a,"array")?b.attr(a):null!=a&&b.attr({points:a}),b},function(){a.gradient=function(a){return D(this.defs,a)},a.gradientLinear=function(a,b,c,d){return E(this.defs,a,b,c,d)},a.gradientRadial=function(a,b,c,d,e){return F(this.defs,a,b,c,d,e)},a.toString=function(){var a,b=I.doc.createDocumentFragment(),c=I.doc.createElement("div"),d=this.node.cloneNode(!0);return b.appendChild(c),c.appendChild(d),e(d,{xmlns:gb}),a=c.innerHTML,b.removeChild(b.firstChild),a},a.clear=function(){for(var a,b=this.node.firstChild;b;)a=b.nextSibling,"defs"!=b.tagName&&b.parentNode.removeChild(b),b=a}}()}(y.prototype),d.ajax=function(a,c,d,e){var g=new XMLHttpRequest,h=eb();if(g){if(f(c,"function"))e=d,d=c,c=null;else if(f(c,"object")){var i=[];for(var j in c)c.hasOwnProperty(j)&&i.push(encodeURIComponent(j)+"="+encodeURIComponent(c[j]));c=i.join("&")}return g.open(c?"POST":"GET",a,!0),g.setRequestHeader("X-Requested-With","XMLHttpRequest"),c&&g.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d&&(b.once("snap.ajax."+h+".0",d),b.once("snap.ajax."+h+".200",d),b.once("snap.ajax."+h+".304",d)),g.onreadystatechange=function(){4==g.readyState&&b("snap.ajax."+h+"."+g.status,e,g)},4==g.readyState?g:(g.send(c),g)}},d.load=function(a,b,c){d.ajax(a,function(a){var e=d.parse(a.responseText);c?b.call(c,e):b(e)})},b.on("snap.util.attr.mask",function(a){if(a instanceof u||a instanceof w){if(b.stop(),a instanceof w&&1==a.node.childNodes.length&&(a=a.node.firstChild,r(this).appendChild(a),a=z(a)),"mask"==a.type)var c=a;else c=x("mask",r(this)),c.node.appendChild(a.node),!c.node.id&&e(c.node,{id:c.id});e(this.node,{mask:ib(c.id)})}}),function(a){b.on("snap.util.attr.clip",a),b.on("snap.util.attr.clip-path",a),b.on("snap.util.attr.clipPath",a)}(function(a){if(a instanceof u||a instanceof w){if(b.stop(),"clipPath"==a.type)var c=a;else c=x("clipPath",r(this)),c.node.appendChild(a.node),!c.node.id&&e(c.node,{id:c.id});e(this.node,{"clip-path":ib(c.id)})}}),b.on("snap.util.attr.fill",G("fill")),b.on("snap.util.attr.stroke",G("stroke"));var sb=/^([lr])(?:\(([^)]*)\))?(.*)$/i;b.on("snap.util.grad.parse",function(a){a=K(a);var b=a.match(sb);if(!b)return null;var c=b[1],d=b[2],e=b[3];return d=d.split(/\s*,\s*/).map(function(a){return+a==a?+a:a}),1==d.length&&0==d[0]&&(d=[]),e=e.split("-"),e=e.map(function(a){a=a.split(":");var b={color:a[0]};return a[1]&&(b.offset=a[1]),b}),{type:c,params:d,stops:e}}),b.on("snap.util.attr.d",function(a){b.stop(),f(a,"array")&&f(a[0],"array")&&(a=d.path.toString.call(a)),a=K(a),a.match(/[ruo]/i)&&(a=d.path.toAbsolute(a)),e(this.node,{d:a})})(-1),b.on("snap.util.attr.#text",function(a){b.stop(),a=K(a);for(var c=I.doc.createTextNode(a);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(c)})(-1),b.on("snap.util.attr.path",function(a){b.stop(),this.attr({d:a})})(-1),b.on("snap.util.attr.viewBox",function(a){var c;c=f(a,"object")&&"x"in a?[a.x,a.y,a.width,a.height].join(" "):f(a,"array")?a.join(" "):a,e(this.node,{viewBox:c}),b.stop()})(-1),b.on("snap.util.attr.transform",function(a){this.transform(a),b.stop()})(-1),b.on("snap.util.attr.r",function(a){"rect"==this.type&&(b.stop(),e(this.node,{rx:a,ry:a}))})(-1),b.on("snap.util.attr.textpath",function(a){if(b.stop(),"text"==this.type){var c,d,g;if(!a&&this.textPath){for(d=this.textPath;d.node.firstChild;)this.node.appendChild(d.node.firstChild);return d.remove(),delete this.textPath,void 0}if(f(a,"string")){var h=r(this),i=z(h.parentNode).path(a);h.appendChild(i.node),c=i.id,i.attr({id:c})}else a=z(a),a instanceof u&&(c=a.attr("id"),c||(c=a.id,a.attr({id:c})));if(c)if(d=this.textPath,g=this.node,d)d.attr({"xlink:href":"#"+c});else{for(d=e("textPath",{"xlink:href":"#"+c});g.firstChild;)d.appendChild(g.firstChild);g.appendChild(d),this.textPath=z(d)}}})(-1),b.on("snap.util.attr.text",function(a){if("text"==this.type){for(var c=this.node,d=function(a){var b=e("tspan");if(f(a,"array"))for(var c=0;c<a.length;c++)b.appendChild(d(a[c]));else b.appendChild(I.doc.createTexLine truncated
|
||||
},a.filter.shadow.toString=function(){return this()},a.filter.grayscale=function(b){return null==b&&(b=1),a.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>',{a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},a.filter.grayscale.toString=function(){return this()},a.filter.sepia=function(b){return null==b&&(b=1),a.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>',{a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},a.filter.sepia.toString=function(){return this()},a.filter.saturate=function(b){return null==b&&(b=1),a.format('<feColorMatrix type="saturate" values="{amount}"/>',{amount:1-b})},a.filter.saturate.toString=function(){return this()},a.filter.hueRotate=function(b){return b=b||0,a.format('<feColorMatrix type="hueRotate" values="{angle}"/>',{angle:b})},a.filter.hueRotate.toString=function(){return this()},a.filter.invert=function(b){return null==b&&(b=1),a.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>',{amount:b,amount2:1-b})},a.filter.invert.toString=function(){return this()},a.filter.brightness=function(b){return null==b&&(b=1),a.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>',{amount:b})},a.filter.brightness.toString=function(){return this()},a.filter.contrast=function(b){return null==b&&(b=1),a.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>',{amount:b,amount2:.5-b/2})},a.filter.contrast.toString=function(){return this()}}),d});
|
||||
@@ -0,0 +1,379 @@
|
||||
//(function ($) {
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
var _window = $(window);
|
||||
var _windowsize = _window.width();
|
||||
var resize_flag = -1;
|
||||
var top_for_row = 0;
|
||||
|
||||
inside_row_();
|
||||
sticky_relocate();
|
||||
|
||||
_window.resize(function() {
|
||||
resize_flag = 0;
|
||||
_windowsize = _window.width();
|
||||
sticky_relocate();
|
||||
//inside_row_();
|
||||
});
|
||||
|
||||
_window.bind('scroll', function() {
|
||||
sticky_relocate();
|
||||
});
|
||||
|
||||
function inside_row_(){
|
||||
|
||||
var row_elements = $('div.ult-sticky-anchor');
|
||||
|
||||
row_elements.each(function(){
|
||||
|
||||
|
||||
var $this = $(this);
|
||||
var ult_row_spacer = $this.closest('.ult_row_spacer');
|
||||
var ult_sticky = $this.find('.ult-sticky');
|
||||
var stick_behaviour = ult_sticky.data('stick_behaviour');
|
||||
var support = ult_sticky.data('support');
|
||||
|
||||
if ( stick_behaviour != 'stick_with_scroll_row' && support == 'no' ){
|
||||
return;
|
||||
}
|
||||
|
||||
/*var fullwidth_row = false; //for Browser full width row
|
||||
|
||||
if ( $this.parents('.upb-background-text').length ){ // has parent
|
||||
fullwidth_row = true;
|
||||
}*/
|
||||
var global_height = 0; //for resize
|
||||
var gutter = ult_sticky.data('gutter');
|
||||
|
||||
var gutter_class = ult_sticky.data('sticky_gutter_class');
|
||||
var gutter_id = ult_sticky.data('sticky_gutter_id');
|
||||
var mobile = ult_sticky.data('mobile');
|
||||
//if ( stick_behaviour == 'stick_with_scroll_row' ) {
|
||||
|
||||
gutter = ult_explode_offset( global_height, gutter, gutter_class, gutter_id );
|
||||
var parent = $this.closest(".wpb_column").closest('.vc_row');//parent();//$this.closest('.vc_row');
|
||||
|
||||
var self_offset = $this.parent().offset().top;
|
||||
//alert(parent_offset);
|
||||
$this.addClass("ult_stick_to_row");
|
||||
|
||||
parent.addClass("ult_s_container");
|
||||
//alert(parent);
|
||||
//alert(mobile);
|
||||
if (support == 'yes') {
|
||||
parent = 'body';
|
||||
}
|
||||
if( _windowsize < 768 && mobile == 'no'){
|
||||
return;
|
||||
}else{
|
||||
$this.fixTo(parent, {
|
||||
//className : 'is-stuck',
|
||||
//zIndex: 10,
|
||||
top: gutter,
|
||||
useNativeSticky: false
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/***** inside row ******/
|
||||
/*function inside_row () {
|
||||
var row_elements = $('div.ult-sticky-anchor');
|
||||
|
||||
row_elements.each(function(){
|
||||
|
||||
|
||||
var $this = $(this);
|
||||
var ult_row_spacer = $this.closest('.ult_row_spacer');
|
||||
var ult_sticky = $this.find('.ult-sticky');
|
||||
var stick_behaviour = ult_sticky.data('stick_behaviour');
|
||||
|
||||
if ( stick_behaviour != 'stick_with_scroll_row' ){
|
||||
return;
|
||||
}
|
||||
|
||||
var fullwidth_row = false; //for Browser full width row
|
||||
|
||||
if ( $this.parents('.upb-background-text').length ){ // has parent
|
||||
fullwidth_row = true;
|
||||
}
|
||||
var global_height = 0; //for resize
|
||||
var gutter = ult_sticky.data('gutter');
|
||||
|
||||
var gutter_class = ult_sticky.data('sticky_gutter_class');
|
||||
var gutter_id = ult_sticky.data('sticky_gutter_id');
|
||||
var mobile = ult_sticky.data('mobile');
|
||||
//if ( stick_behaviour == 'stick_with_scroll_row' ) {
|
||||
|
||||
gutter = ult_explode_offset( global_height, gutter, gutter_class, gutter_id );
|
||||
var parent = $this.closest(".wpb_column").parent();//$this.closest('.vc_row');
|
||||
|
||||
var self_offset = $this.parent().offset().top;
|
||||
//alert(parent_offset);
|
||||
$this.addClass("ult_stick_to_row");
|
||||
|
||||
parent.addClass("ult_s_container");
|
||||
//alert(parent);
|
||||
//alert(mobile);
|
||||
if( _windowsize < 768 && mobile == 'no'){
|
||||
$this.trigger("sticky_kit:detach")
|
||||
return;
|
||||
}else{
|
||||
$this.trigger("sticky_kit:recalc")
|
||||
|
||||
$this.stick_in_parent({parent:".ult_s_container", offset_top:gutter, spacer: ult_row_spacer})
|
||||
.on("sticky_kit:stick", function(e) {
|
||||
//console.log("has stuck!", e.target);
|
||||
//console.log( $(e.target).closest(".wpb_column").parent().css("display", "flex") );
|
||||
$(e.target).css("top", "0");
|
||||
//console.log($(e.target).offset().top);
|
||||
$(e.target).closest(".wpb_column").parent().css("display", "flex");
|
||||
})
|
||||
.on("sticky_kit:unstick", function(e) {
|
||||
//console.log("has unstuck!", e.target);
|
||||
//$(e.target).closest(".vc_row").css("display", "")
|
||||
|
||||
$(e.target).closest(".wpb_column").parent().css("display", "")
|
||||
})
|
||||
.on("sticky_kit:bottom", function(e) {
|
||||
//console.log("has stuck!", e.target);
|
||||
$(e.target).addClass("is_bottom");
|
||||
$(e.target).css("bottom","");
|
||||
// var s = $(window).scrollTop();
|
||||
// var y = $(e.target).parent().offset().top;
|
||||
// var z = s-y+50;
|
||||
$(e.target).css('top', top_for_row + 'px');
|
||||
|
||||
})
|
||||
.on("sticky_kit:unbottom", function(e) {
|
||||
//console.log("has unstuck!", e.target);
|
||||
$(e.target).removeClass("is_bottom");
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
/****** inside row end *******/
|
||||
|
||||
|
||||
function sticky_relocate() {
|
||||
|
||||
|
||||
elements = $('div.ult-sticky-anchor');
|
||||
|
||||
elements.each(function() {
|
||||
|
||||
var $this = $(this);
|
||||
var ult_sticky = $this.find('.ult-sticky');
|
||||
//var fullwidth_row = false; //for Browser full width row
|
||||
|
||||
// if ( $this.parents('.upb-background-text').length ){ // has parent
|
||||
// fullwidth_row = true;
|
||||
// }
|
||||
|
||||
var mobile = ult_sticky.data('mobile');
|
||||
var ult_space = $this.find('.ult-space');
|
||||
if ( _windowsize < 768 && mobile == 'no' ){
|
||||
ult_sticky.removeClass("ult-stick");
|
||||
ult_space.css('height', '')
|
||||
$this.removeClass('ult-permanent-flag');
|
||||
return;
|
||||
}
|
||||
|
||||
var window_top = _window.scrollTop();
|
||||
var div_top = $this.offset().top;
|
||||
var win_height = _window.height();
|
||||
var stick_behaviour = ult_sticky.data('stick_behaviour');
|
||||
var support = ult_sticky.data('support');
|
||||
|
||||
// if( fullwidth_row = true && $this.hasClass( "is_stuck" ) ){
|
||||
// var s = _window.scrollTop();
|
||||
// var parent_height = $this.closest(".wpb_column").parent().parent().innerHeight();
|
||||
// var parent_offset = $this.closest(".wpb_column").parent().parent().offset().top;
|
||||
// var parent_offset_height = parseInt(parent_offset) + parseInt(parent_height);
|
||||
// var y = $this.parent().offset().top;
|
||||
// var z = s-y+50;
|
||||
// var anchor_height = s + 50 + $this.outerHeight();
|
||||
|
||||
// console.log(parent_offset);
|
||||
// console.log(window_top);
|
||||
|
||||
// if( anchor_height < parent_offset_height ){
|
||||
// top_for_row = z;
|
||||
// $this.css('position','absolute');
|
||||
// $this.css('top',z + 'px');
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
if( stick_behaviour == 'stick_with_scroll_row' || support == 'yes'){
|
||||
return;
|
||||
}
|
||||
|
||||
var div_width = $this.parent().width();
|
||||
var div_height = ult_sticky.height();//$(this).parents(".vc_row").height();
|
||||
|
||||
var global_height = 0; //for resize
|
||||
var gutter = ult_sticky.data('gutter');
|
||||
|
||||
var gutter_class = ult_sticky.data('sticky_gutter_class');
|
||||
var gutter_id = ult_sticky.data('sticky_gutter_id');
|
||||
|
||||
var lr_position = ult_sticky.data('lr_position');
|
||||
var lr_value = ult_sticky.data('lr_value');
|
||||
|
||||
var sticky_customwidth = ult_sticky.data('sticky_customwidth');
|
||||
var sticky_width = ult_sticky.data('sticky_width');
|
||||
var sticky_position = ult_sticky.data('sticky_position');
|
||||
var flag = -1; //for bottom position
|
||||
//var sticky_element = $(this).find('ult-sticky');
|
||||
|
||||
|
||||
gutter = ult_explode_offset( global_height, gutter, gutter_class, gutter_id );
|
||||
|
||||
if( sticky_position == 'top'){
|
||||
window_top = parseInt(window_top) + parseInt(gutter);
|
||||
}else{
|
||||
window_top = parseInt(window_top)+ parseInt(win_height)-parseInt(div_height)-parseInt(gutter);
|
||||
div_top = parseInt(div_top); //+ parseInt(div_height);
|
||||
|
||||
}
|
||||
|
||||
if(sticky_width == 'fullwidth' ){
|
||||
div_width = '100%';
|
||||
}else if( sticky_width == 'customwidth' ) {
|
||||
div_width = sticky_customwidth ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var custom_css = {};
|
||||
var div_width_pro = 'width';
|
||||
|
||||
custom_css[sticky_position] = gutter;
|
||||
custom_css[div_width_pro] = div_width;
|
||||
// for permanent
|
||||
if ( stick_behaviour == 'stick_permanent') {
|
||||
custom_css[lr_position] = lr_value;
|
||||
}
|
||||
|
||||
|
||||
var custom_css_t = {};
|
||||
custom_css_t[sticky_position] = "";
|
||||
custom_css_t[div_width_pro] = "";
|
||||
|
||||
if ( stick_behaviour == 'stick_permanent' && !$this.hasClass('ult-permanent-flag') ) {
|
||||
$this.addClass('ult-permanent-flag');
|
||||
ult_sticky.addClass('ult-stick').css(custom_css);
|
||||
//$this.parents('.wpb_column').css('min-height', '0px');
|
||||
}
|
||||
//alert(stick_behaviour);
|
||||
|
||||
if ( stick_behaviour == 'stick_with_scroll' && window_top > div_top ) {
|
||||
//alert(resize_flag);
|
||||
flag=0;
|
||||
if( !$this.hasClass('ult-flag') || resize_flag == 0){
|
||||
$this.addClass('ult-flag');
|
||||
//resize_flag = -1;
|
||||
|
||||
if ( sticky_width == 'fullwidth' ) {
|
||||
|
||||
ult_sticky.addClass('ult-stick-full-width').css(custom_css);
|
||||
//div_height = $(this).find('.ult-sticky').height();
|
||||
|
||||
$this.find('.ult-space').css('height', div_height);
|
||||
flag=1;
|
||||
}else{
|
||||
|
||||
ult_sticky.addClass('ult-stick').css(custom_css);
|
||||
//div_height = $(this).find('.ult-sticky').height();
|
||||
|
||||
$this.find('.ult-space').css('height', div_height);
|
||||
flag=1;
|
||||
} // checked fullwidth end else
|
||||
} //checked ult flag end if
|
||||
} else if( stick_behaviour == 'stick_with_scroll' ) {
|
||||
if( $this.hasClass('ult-flag') ){
|
||||
$this.removeClass('ult-flag');
|
||||
|
||||
if ( sticky_width == 'fullwidth' ) {
|
||||
ult_sticky.removeClass('ult-stick-full-width').css( custom_css_t );
|
||||
|
||||
$this.find('.ult-space').css('height', '');
|
||||
}else{
|
||||
ult_sticky.removeClass('ult-stick').css( custom_css_t );
|
||||
|
||||
$this.find('.ult-space').css('height', '');
|
||||
}
|
||||
}//checked ult flag if end
|
||||
}// scroll top else end
|
||||
|
||||
/* if( sticky_position == 'bottom' && flag != 1 && !$this.hasClass('ult-permanent-flag') )
|
||||
{
|
||||
//var scroll_flag = -1;
|
||||
var temp_top = "";
|
||||
if( window_top > div_top) {
|
||||
//scroll_flag = 0;
|
||||
temp_top = window_top-div_top;
|
||||
} else {
|
||||
// alert();
|
||||
temp_top = 0;
|
||||
}
|
||||
if( window_top > div_top ) { div_height = ult_sticky.height(); }
|
||||
else { div_height = $this.find('.ult-space').height();}
|
||||
|
||||
|
||||
if( div_height - temp_top <= 0 ){
|
||||
div_height = 0;
|
||||
} else{
|
||||
div_height = div_height - temp_top;
|
||||
}
|
||||
|
||||
$this.find('.ult-space').css('height', div_height);
|
||||
}*/
|
||||
});
|
||||
resize_flag = -1;
|
||||
}
|
||||
|
||||
function ult_explode_offset (global_height, gutter, gutter_class, gutter_id ) {
|
||||
// gutter class and id height calculate
|
||||
if( !gutter_class ){
|
||||
gutter_class = 'null';
|
||||
}
|
||||
else{
|
||||
var gutter_class_arr = gutter_class.split(' ');
|
||||
jQuery.each( gutter_class_arr, function( i, val ) {
|
||||
global_height = parseInt(global_height) + $( val ).outerHeight();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if( !gutter_id ){
|
||||
gutter_id = 'null';
|
||||
}
|
||||
else{
|
||||
var gutter_id_arr = gutter_id.split(' ');
|
||||
jQuery.each( gutter_id_arr, function( i, val ) {
|
||||
global_height = parseInt(global_height) + $( val ).outerHeight();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if ( !gutter ){
|
||||
gutter = global_height;
|
||||
}else{
|
||||
gutter = parseInt(gutter) + parseInt(global_height)
|
||||
}
|
||||
|
||||
return gutter;
|
||||
}
|
||||
|
||||
|
||||
//$(window).scroll(sticky_relocate);
|
||||
//sticky_relocate();
|
||||
});
|
||||
|
||||
//})(jQuery);
|
||||
@@ -0,0 +1,249 @@
|
||||
/**
|
||||
* jquery.swatchbook.js v1.1.0
|
||||
* http://www.codrops.com
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Copyright 2012, Codrops
|
||||
* http://www.codrops.com
|
||||
*/
|
||||
|
||||
;( function( $, window, undefined ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// global
|
||||
var Modernizr = window.bsfmodernizr;
|
||||
|
||||
jQuery.fn.reverse = [].reverse;
|
||||
|
||||
$.SwatchBook = function( options, element ) {
|
||||
|
||||
this.$el = $( element );
|
||||
this._init( options );
|
||||
|
||||
};
|
||||
|
||||
$.SwatchBook.defaults = {
|
||||
// index of initial centered item
|
||||
center : 6,
|
||||
// number of degrees that is between each item
|
||||
angleInc : 8,
|
||||
speed : 700,
|
||||
easing : 'ease',
|
||||
// amount in degrees for the opened item's next sibling
|
||||
proximity : 45,
|
||||
// amount in degrees between the opened item's next siblings
|
||||
neighbor : 4,
|
||||
// animate on load
|
||||
onLoadAnim : true,
|
||||
// if it should be closed by default
|
||||
initclosed : false,
|
||||
// index of the element that when clicked, triggers the open/close function
|
||||
// by default there is no such element
|
||||
closeIdx : -1,
|
||||
// open one specific item initially (overrides initclosed)
|
||||
openAt : -1
|
||||
};
|
||||
|
||||
$.SwatchBook.prototype = {
|
||||
|
||||
_init : function( options ) {
|
||||
|
||||
this.options = $.extend( true, {}, $.SwatchBook.defaults, options );
|
||||
|
||||
this.$items = this.$el.children( 'div' );
|
||||
this.itemsCount = this.$items.length;
|
||||
this.current = -1;
|
||||
this.support = Modernizr.csstransitions;
|
||||
this.cache = [];
|
||||
|
||||
if( this.options.onLoadAnim ) {
|
||||
this._setTransition();
|
||||
}
|
||||
|
||||
if( !this.options.initclosed ) {
|
||||
this._center( this.options.center, this.options.onLoadAnim );
|
||||
}
|
||||
else {
|
||||
|
||||
this.isClosed = true;
|
||||
if( !this.options.onLoadAnim ) {
|
||||
this._setTransition();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( this.options.openAt >= 0 && this.options.openAt < this.itemsCount ) {
|
||||
this._openItem( this.$items.eq( this.options.openAt ) );
|
||||
}
|
||||
|
||||
this._initEvents();
|
||||
|
||||
},
|
||||
_setTransition : function() {
|
||||
|
||||
if( this.support ) {
|
||||
this.$items.css( { 'transition': 'all ' + this.options.speed + 'ms ' + this.options.easing } );
|
||||
}
|
||||
|
||||
},
|
||||
_openclose : function() {
|
||||
|
||||
this.isClosed ? this._center( this.options.center, true ) : this.$items.css( { 'transform' : 'rotate(0deg)' } );
|
||||
this.isClosed = !this.isClosed;
|
||||
|
||||
},
|
||||
_center : function( idx, anim ) {
|
||||
|
||||
var self = this;
|
||||
|
||||
this.$items.each( function( i ) {
|
||||
|
||||
var transformStr = 'rotate(' + ( self.options.angleInc * ( i - idx ) ) + 'deg)';
|
||||
$( this ).css( { 'transform' : transformStr } );
|
||||
|
||||
} );
|
||||
|
||||
},
|
||||
_openItem : function( $item ) {
|
||||
|
||||
var itmIdx = $item.index();
|
||||
|
||||
if( itmIdx !== this.current ) {
|
||||
|
||||
if( this.options.closeIdx !== -1 && itmIdx === this.options.closeIdx ) {
|
||||
|
||||
this._openclose();
|
||||
this._setCurrent();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
this._setCurrent( $item );
|
||||
$item.css( { 'transform' : 'rotate(0deg)' } );
|
||||
this._rotateSiblings( $item );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
_initEvents : function() {
|
||||
|
||||
var self = this;
|
||||
|
||||
this.$items.on( 'click.swatchbook', function( event ) {
|
||||
self._openItem( $( this ) );
|
||||
} );
|
||||
|
||||
},
|
||||
_rotateSiblings : function( $item ) {
|
||||
|
||||
var self = this,
|
||||
idx = $item.index(),
|
||||
$cached = this.cache[ idx ],
|
||||
$siblings;
|
||||
|
||||
if( $cached ) {
|
||||
$siblings = $cached;
|
||||
}
|
||||
else {
|
||||
|
||||
$siblings = $item.siblings();
|
||||
this.cache[ idx ] = $siblings;
|
||||
|
||||
}
|
||||
|
||||
$siblings.each( function( i ) {
|
||||
|
||||
var rotateVal = i < idx ?
|
||||
self.options.angleInc * ( i - idx ) :
|
||||
i - idx === 1 ?
|
||||
self.options.proximity :
|
||||
self.options.proximity + ( i - idx - 1 ) * self.options.neighbor;
|
||||
|
||||
var transformStr = 'rotate(' + rotateVal + 'deg)';
|
||||
|
||||
$( this ).css( { 'transform' : transformStr } );
|
||||
|
||||
} );
|
||||
|
||||
},
|
||||
_setCurrent : function( $el ) {
|
||||
|
||||
this.current = $el ? $el.index() : -1;
|
||||
this.$items.removeClass( 'ff-active' );
|
||||
if( $el ) {
|
||||
$el.addClass( 'ff-active' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var logError = function( message ) {
|
||||
|
||||
if ( window.console ) {
|
||||
|
||||
window.console.error( message );
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn.swatchbook = function( options ) {
|
||||
|
||||
var instance = $.data( this, 'swatchbook' );
|
||||
|
||||
if ( typeof options === 'string' ) {
|
||||
|
||||
var args = Array.prototype.slice.call( arguments, 1 );
|
||||
|
||||
this.each(function() {
|
||||
|
||||
if ( !instance ) {
|
||||
|
||||
logError( "cannot call methods on swatchbook prior to initialization; " +
|
||||
"attempted to call method '" + options + "'" );
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
||||
|
||||
logError( "no such method '" + options + "' for swatchbook instance" );
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
instance[ options ].apply( instance, args );
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
this.each(function() {
|
||||
|
||||
if ( instance ) {
|
||||
|
||||
instance._init();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
instance = $.data( this, 'swatchbook', new $.SwatchBook( options, this ) );
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return instance;
|
||||
|
||||
};
|
||||
|
||||
} )( jQuery, window );
|
||||
@@ -0,0 +1,417 @@
|
||||
jQuery(document).ready(function(a) {
|
||||
a(".cq-accordion").each(function() {
|
||||
a(this), a(this).find("li").each(function() {
|
||||
a(this).find("i").css("margin-top", .5 * (a(this).outerHeight() - 9))
|
||||
})
|
||||
}), a(".ult-tabto-accordion").each(function() {
|
||||
a(this);
|
||||
var c = a(this).data("titlebg"),
|
||||
d = a(this).data("titlecolor"),
|
||||
e = a(this).data("titlehoverbg"),
|
||||
f = a(this).data("titlehovercolor");
|
||||
var act_title = a(this).data("activetitle"),
|
||||
act_icon = a(this).data("activeicon"),
|
||||
scroll_type = a(this).data("scroll"),
|
||||
act_bg = a(this).data("activebg");
|
||||
if(act_icon==''){
|
||||
var act_icon=a(this).find('.aio-icon').data('iconhover');
|
||||
}
|
||||
|
||||
|
||||
a(this).find(".ult-tabto-actitle").each(function() {
|
||||
var iconcolor=a(this).find('.aio-icon').data('iconcolor');
|
||||
var iconhover=a(this).find('.aio-icon').data('iconhover');
|
||||
|
||||
a(this).css("background-color", c).on("mouseover", function() {
|
||||
if(a(this).hasClass('ult-tabto-actitleActive')){
|
||||
|
||||
}
|
||||
else{
|
||||
a(this).css({
|
||||
"background-color": e,
|
||||
color: f
|
||||
}),
|
||||
a(this).find('.aio-icon').css({
|
||||
color: iconhover
|
||||
})
|
||||
}
|
||||
|
||||
}).on("mouseleave", function() {
|
||||
a(this).hasClass("ult-tabto-actitleActive") || a(this).css({
|
||||
"background-color": c,
|
||||
color: d
|
||||
});
|
||||
var flag=a(this).hasClass("ult-tabto-actitleActive");
|
||||
|
||||
if(flag==true){
|
||||
|
||||
}
|
||||
else{
|
||||
a(this).find('.aio-icon').css({
|
||||
color: iconcolor
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}), a(this).on("click", function(b) {
|
||||
var c;
|
||||
if (c = a(b.target).is("i") ? a(b.target).parent() : a(b.target), c.hasClass("ult-tabto-actitle")) {
|
||||
var d = c.parent().next();
|
||||
|
||||
var animation=c.parents('.ult-tabto-accordion').data('animation');
|
||||
// console.log(d);
|
||||
|
||||
if(d.nextAll('dd').hasClass("cq-animateIn")){
|
||||
d.nextAll('dd').removeClass("cq-animateIn").addClass(" cq-animateOut ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
if(d.prevAll('dd').hasClass("cq-animateIn")){
|
||||
d.prevAll('dd').removeClass("cq-animateIn").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
if(d.nextAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.nextAll('dd').removeClass("ult-ac-slidedown").addClass(" ult-ac-slideup ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
if(d.prevAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.prevAll('dd').removeClass("ult-ac-slidedown").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
|
||||
if(d.prevAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.prevAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
if(d.nextAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.nextAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
|
||||
|
||||
c.removeClass('ult-acc-normal');
|
||||
jQuery(this).find(".ult-acc-normal").each(function() {
|
||||
var icn=jQuery(this).find('.aio-icon').data('iconcolor');
|
||||
var ich=jQuery(this).find('.aio-icon').data('iconhover');
|
||||
var bgcolor=jQuery(this).parents('.ult-tabto-accordion').data("titlebg");
|
||||
var titlecolor = jQuery(this).parents('.ult-tabto-accordion').data("titlecolor");
|
||||
jQuery(this).css({background: bgcolor,color:titlecolor});
|
||||
jQuery(this).find('.aio-icon').css({color: icn});
|
||||
|
||||
});
|
||||
|
||||
|
||||
c.css({
|
||||
color: act_title,
|
||||
"background-color": act_bg,
|
||||
});
|
||||
c.find('.aio-icon').css({
|
||||
color: act_icon
|
||||
|
||||
});
|
||||
|
||||
var iconcolor=c.find('.aio-icon').data('iconcolor');
|
||||
var iconhover=c.find('.aio-icon').data('iconhover');
|
||||
|
||||
|
||||
if(animation=='Fade'){
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("cq-animateOut") && d.removeClass("cq-animateOut"), d.addClass("cq-animateIn")) : (d.removeClass("cq-animateIn"), d.addClass("cq-animateOut")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
|
||||
}
|
||||
else{
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("ult-ac-slideup") && d.removeClass("ult-ac-slideup"), d.addClass("ult-ac-slidedown")) : (d.removeClass("ult-ac-slidedown"), d.addClass("ult-ac-slideup")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
|
||||
}
|
||||
|
||||
if( d.hasClass("ult-tabto-accolapsed")){
|
||||
c.removeClass("ult-tabto-actitleActive")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (c = a(b.target).is("span.ult-span-text.ult_acordian-text") ? a(b.target).parent().parent() : a(b.target), c.hasClass("ult-tabto-actitle")) {
|
||||
var d = c.parent().next();
|
||||
var animation=c.parents('.ult-tabto-accordion').data('animation');
|
||||
//console.log('2');
|
||||
if(d.nextAll('dd').hasClass("cq-animateIn")){
|
||||
d.nextAll('dd').removeClass("cq-animateIn").addClass(" ult-ac-slideup ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
|
||||
if(d.prevAll('dd').hasClass("cq-animateIn")){
|
||||
d.prevAll('dd').removeClass("cq-animateIn").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
if(d.nextAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.nextAll('dd').removeClass("ult-ac-slidedown").addClass(" ult-ac-slideup ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
if(d.prevAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.prevAll('dd').removeClass("ult-ac-slidedown").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
if(d.prevAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.prevAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
if(d.nextAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.nextAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
|
||||
|
||||
c.removeClass('ult-acc-normal');
|
||||
jQuery(this).find(".ult-acc-normal").each(function() {
|
||||
var icn=jQuery(this).find('.aio-icon').data('iconcolor');
|
||||
var ich=jQuery(this).find('.aio-icon').data('iconhover');
|
||||
var bgcolor=jQuery(this).parents('.ult-tabto-accordion').data("titlebg");
|
||||
var titlecolor = jQuery(this).parents('.ult-tabto-accordion').data("titlecolor");
|
||||
jQuery(this).css({background: bgcolor,color:titlecolor});
|
||||
jQuery(this).find('.aio-icon').css({color: icn});
|
||||
|
||||
});
|
||||
|
||||
|
||||
var iconcolor=c.find('.aio-icon').data('iconcolor');
|
||||
var iconhover=c.find('.aio-icon').data('iconhover');
|
||||
|
||||
c.css({
|
||||
color: act_title,
|
||||
"background-color": act_bg,
|
||||
});
|
||||
c.find('.aio-icon').css({
|
||||
color: act_icon
|
||||
|
||||
});
|
||||
|
||||
if(animation=='Fade'){
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("cq-animateOut") && d.removeClass("cq-animateOut"), d.addClass("cq-animateIn")) : (d.removeClass("cq-animateIn"), d.addClass("cq-animateOut")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
}
|
||||
else{
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("ult-ac-slideup") && d.removeClass("ult-ac-slideup"), d.addClass("ult-ac-slidedown")) : (d.removeClass("ult-ac-slidedown"), d.addClass("ult-ac-slideup")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
}
|
||||
|
||||
if( d.hasClass("ult-tabto-accolapsed")){
|
||||
c.removeClass("ult-tabto-actitleActive")
|
||||
}
|
||||
|
||||
}
|
||||
else if (c = a(b.target).is("i") ? a(b.target).parent().parent() : a(b.target), c.hasClass("ult-tabto-actitle")) {
|
||||
var d = c.parent().next();
|
||||
var animation=c.parents('.ult-tabto-accordion').data('animation');
|
||||
|
||||
if( d.nextAll('dd').hasClass("cq-animateIn")){
|
||||
d.nextAll('dd').removeClass("cq-animateIn").addClass(" cq-animateOut ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
|
||||
if(d.prevAll('dd').hasClass("cq-animateIn")){
|
||||
d.prevAll('dd').removeClass("cq-animateIn").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
if(d.nextAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.nextAll('dd').removeClass("ult-ac-slidedown").addClass(" ult-ac-slideup ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
if(d.prevAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.prevAll('dd').removeClass("ult-ac-slidedown").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
if(d.prevAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.prevAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
if(d.nextAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.nextAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
|
||||
|
||||
c.removeClass('ult-acc-normal');
|
||||
jQuery(this).find(".ult-acc-normal").each(function() {
|
||||
var icn=jQuery(this).find('.aio-icon').data('iconcolor');
|
||||
var ich=jQuery(this).find('.aio-icon').data('iconhover');
|
||||
var bgcolor=jQuery(this).parents('.ult-tabto-accordion').data("titlebg");
|
||||
var titlecolor = jQuery(this).parents('.ult-tabto-accordion').data("titlecolor");
|
||||
jQuery(this).css({background: bgcolor,color:titlecolor});
|
||||
jQuery(this).find('.aio-icon').css({color: icn});
|
||||
|
||||
});
|
||||
|
||||
var iconcolor=c.find('.aio-icon').data('iconcolor');
|
||||
var iconhover=c.find('.aio-icon').data('iconhover');
|
||||
|
||||
c.css({
|
||||
color: act_title,
|
||||
"background-color": act_bg,
|
||||
});
|
||||
c.find('.aio-icon').css({
|
||||
color: act_icon
|
||||
|
||||
});
|
||||
|
||||
|
||||
if(animation=='Fade'){
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("cq-animateOut") && d.removeClass("cq-animateOut"), d.addClass("cq-animateIn")) : (d.removeClass("cq-animateIn"), d.addClass("cq-animateOut")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
}
|
||||
else{
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("ult-ac-slideup") && d.removeClass("ult-ac-slideup"), d.addClass("ult-ac-slidedown")) : (d.removeClass("ult-ac-slidedown"), d.addClass("ult-ac-slideup")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
}
|
||||
|
||||
if( d.hasClass("ult-tabto-accolapsed")){
|
||||
c.removeClass("ult-tabto-actitleActive")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (c = a(b.target).is("i") ? a(b.target).parent().parent().parent() : a(b.target), c.hasClass("ult-tabto-actitle")) {
|
||||
var d = c.parent().next();
|
||||
var animation=c.parents('.ult-tabto-accordion').data('animation');
|
||||
|
||||
if( d.nextAll('dd').hasClass("cq-animateIn")){
|
||||
d.nextAll('dd').removeClass("cq-animateIn").addClass(" cq-animateOut ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
|
||||
if(d.prevAll('dd').hasClass("cq-animateIn")){
|
||||
d.prevAll('dd').removeClass("cq-animateIn").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
if(d.nextAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.nextAll('dd').removeClass("ult-ac-slidedown").addClass(" ult-ac-slideup ult-tabto-accolapsed");
|
||||
|
||||
}
|
||||
if(d.prevAll('dd').hasClass("ult-ac-slidedown")){
|
||||
d.prevAll('dd').removeClass("ult-ac-slidedown").addClass("ult-tabto-accolapsed");
|
||||
}
|
||||
|
||||
if(d.prevAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.prevAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
if(d.nextAll('dt').find('.ult-tabto-actitle').hasClass("ult-tabto-actitleActive")){
|
||||
d.nextAll('dt').find('.ult-tabto-actitle').removeClass("ult-tabto-actitleActive").addClass("ult-acc-normal");
|
||||
}
|
||||
|
||||
|
||||
c.removeClass('ult-acc-normal');
|
||||
jQuery(this).find(".ult-acc-normal").each(function() {
|
||||
var icn=jQuery(this).find('.aio-icon').data('iconcolor');
|
||||
var ich=jQuery(this).find('.aio-icon').data('iconhover');
|
||||
var bgcolor=jQuery(this).parents('.ult-tabto-accordion').data("titlebg");
|
||||
var titlecolor = jQuery(this).parents('.ult-tabto-accordion').data("titlecolor");
|
||||
jQuery(this).css({background: bgcolor,color:titlecolor});
|
||||
jQuery(this).find('.aio-icon').css({color: icn});
|
||||
|
||||
});
|
||||
|
||||
var iconcolor=c.find('.aio-icon').data('iconcolor');
|
||||
var iconhover=c.find('.aio-icon').data('iconhover');
|
||||
|
||||
c.css({
|
||||
color: act_title,
|
||||
"background-color": act_bg,
|
||||
});
|
||||
c.find('.aio-icon').css({
|
||||
color: act_icon
|
||||
|
||||
});
|
||||
|
||||
|
||||
if(animation=='Fade'){
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("cq-animateOut") && d.removeClass("cq-animateOut"), d.addClass("cq-animateIn")) : (d.removeClass("cq-animateIn"), d.addClass("cq-animateOut")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
}
|
||||
else{
|
||||
c.toggleClass("ult-tabto-actitleActive"), d.hasClass("ult-tabto-accolapsed") ? (d.hasClass("ult-ac-slideup") && d.removeClass("ult-ac-slideup"), d.addClass("ult-ac-slidedown")) : (d.removeClass("ult-ac-slidedown"), d.addClass("ult-ac-slideup")), d.toggleClass("ult-tabto-accolapsed"), b.preventDefault();
|
||||
}
|
||||
|
||||
if( d.hasClass("ult-tabto-accolapsed")){
|
||||
c.removeClass("ult-tabto-actitleActive")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(scroll_type=='on'){
|
||||
jQuery('html, body').animate({
|
||||
scrollTop: a(this).offset().top-100
|
||||
}, 1200);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// to open accordion from other pages
|
||||
open_accordion();
|
||||
|
||||
//open accordion as per index
|
||||
jQuery(".ult-tabto-accordion").each(function() {
|
||||
var index = jQuery(this).data("activeindex");
|
||||
index = index-1;
|
||||
if(index >= 0){
|
||||
var current_tab = jQuery(this).find("dl dt:nth("+index+")");
|
||||
var id = current_tab.find(".ult-tabto-actitle").attr("id");
|
||||
if( id !== '' && typeof id!='undefined'){
|
||||
open_accordion(id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//open accordion on click of menu or same page link
|
||||
jQuery(this).find("a").click(function(b) {
|
||||
var href= jQuery(this).attr("href");
|
||||
if( typeof href !== 'undefined' && href.length > 0 ){
|
||||
|
||||
var class_name = jQuery(this).hasClass('ult-tabto-actitle');
|
||||
var type = escape(href.substring(href.indexOf('#')+1));
|
||||
var maintab=jQuery("a.ult-tabto-actitle[href$='"+type+"']");
|
||||
var tabid = maintab.attr('href');
|
||||
var titlecolor= maintab.parents(".ult-tabto-accordion").data("titlecolor");
|
||||
var titlebg= maintab.parents(".ult-tabto-accordion").data("titlebg");
|
||||
|
||||
if( typeof tabid!='undefined' && tabid !== '' ){
|
||||
tabid = tabid.replace("#", "");
|
||||
}
|
||||
if( maintab.parents(".ult-tabto-accordion").length > 0 && type == tabid && !class_name )
|
||||
{
|
||||
maintab.parents(".ult-tabto-accordion").find(".ult-tabto-actitle").each(function(index, el) {
|
||||
var id = jQuery(this).attr("id");
|
||||
if(tabid!== id){
|
||||
jQuery(this).parent().removeClass('current');
|
||||
jQuery(this).removeClass('ult-tabto-actitleActive');
|
||||
jQuery(this).css({"background":titlebg,"color":titlecolor});
|
||||
var icon_color= jQuery(this).find(".aio-icon").data("iconcolor");
|
||||
jQuery(this).find(".ult_tab_icon").css({"color":icon_color});
|
||||
jQuery(this).parents("dt").next("dd").addClass('ult-tabto-accolapsed');
|
||||
}
|
||||
});
|
||||
open_accordion(tabid);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery(this).find("a.ult-tabto-actitle").click(function(b) {
|
||||
var main_div = jQuery(this).parents(".ult-tabto-accordion");
|
||||
var current_id = jQuery(this).attr("id");
|
||||
main_div.find(".ult-tabto-actitle").each(function(index, el) {
|
||||
var id = jQuery(this).attr("id");
|
||||
if( current_id !== id ){
|
||||
jQuery(this).parents("dt").next("dd").addClass('ult-tabto-accolapsed');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function open_accordion(id){
|
||||
var type = escape( window.location.hash.substr(1) );
|
||||
|
||||
if( id !== '' && typeof id!='undefined'){
|
||||
type = id ;
|
||||
}
|
||||
|
||||
if(type!=''){
|
||||
var current_tab = jQuery(".ult_acord ").find("#"+type);
|
||||
var classm = current_tab.addClass('ult-tabto-actitleActive');
|
||||
var bg_color = current_tab.parents(".ult-tabto-accordion").data("activebg");
|
||||
var activetitle = current_tab.parents(".ult-tabto-accordion").data("activetitle");
|
||||
var iconcolor = current_tab.find(".aio-icon").data("iconhover");
|
||||
current_tab.css('background-color',bg_color);
|
||||
current_tab.css('color',activetitle);
|
||||
current_tab.find(".aio-icon").css('color',iconcolor);
|
||||
jQuery(".ult_acord ").find("#"+type).parents("dt").next("dd").removeClass('ult-tabto-accolapsed');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,646 @@
|
||||
jQuery(document).ready(function(a) {
|
||||
a(".ult_tabs").each(function() {
|
||||
function m() {
|
||||
clearTimeout(l), k++, k > j - 1 && (k = 0), l = setTimeout(function() {
|
||||
c.find("ul.ult_tabmenu li.ult_tab_li").each(function(b) {
|
||||
k == b && a(this).find("a.ult_a").trigger("click")
|
||||
})
|
||||
}, 1e3 * i)
|
||||
}
|
||||
|
||||
var c = a(this),
|
||||
d = a(this).data("tabsstyle"),
|
||||
e = a(this).data("titlecolor"),
|
||||
f = a(this).data("titlebg"),
|
||||
g = a(this).data("titlehovercolor"),
|
||||
h = a(this).data("titlehoverbg"),
|
||||
i = parseInt(a(this).data("rotatetabs")),
|
||||
|
||||
j = a(this).find("ul.ult_tabmenu li.ult_tab_li").length,
|
||||
act_title = a(this).data("activetitle"),
|
||||
act_icon = a(this).data("activeicon"),
|
||||
act_bg = a(this).data("activebg"),
|
||||
ht_width=parseInt(a(this).find(".ult_tabcontent").outerWidth()),
|
||||
k = 0;
|
||||
var lastid=[];
|
||||
lastid.push(0);
|
||||
a(this).find("ul.ult_tabmenu").addClass("active").find("> li.ult_tab_li:eq(0)").addClass("current"), a(this).find("ul.ult_tabmenu li.ult_tab_li").each(function(b) {
|
||||
var iconh = a(this).data("iconhover"),
|
||||
iconc = a(this).data("iconcolor");
|
||||
if(act_icon==''){
|
||||
|
||||
act_icon=iconh;
|
||||
}
|
||||
|
||||
0 == b && ("style2" == d || "style1" == d ? (a(this).find("a.ult_a").css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),a(this).find(".ult_tab_icon").css({
|
||||
color:act_icon
|
||||
})) : (a(this).find("a.ult_a").css({
|
||||
color: act_title,
|
||||
}), a(this).css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),a(this).find(".ult_tab_icon").css({
|
||||
color:act_title
|
||||
})
|
||||
)),
|
||||
|
||||
a(this).on("mouseover", function() {
|
||||
if(a(this).hasClass("current"))
|
||||
{
|
||||
|
||||
}
|
||||
else{
|
||||
a(this).hasClass("current") || "style2" == d || "style1" == d ? (a(this).find("a.ult_a").css({
|
||||
background: h,
|
||||
color: g
|
||||
}) ,a(this).find(".ult_tab_icon").css({
|
||||
color:iconh
|
||||
})): (a(this).find("a.ult_a").css({
|
||||
color: g
|
||||
}), a(this).css({
|
||||
background: h,
|
||||
color: g
|
||||
}) , a(this).find("a.ult_a").find(".ult_tab_icon").css({
|
||||
color: iconh})
|
||||
)}
|
||||
}).on("mouseleave", function() {
|
||||
a(this).hasClass("current") || ("style2" == d || "style1" == d ? (a(this).find("a.ult_a").css({
|
||||
background: f,
|
||||
color: e
|
||||
}),a(this).find(".ult_tab_icon").css({
|
||||
color:iconc
|
||||
}) ): (a(this).find("a.ult_a").css({
|
||||
color: e
|
||||
}), a(this).css({
|
||||
background: f,
|
||||
color: e
|
||||
}), a(this).find("a.ult_a").find(".ult_tab_icon").css({
|
||||
color: iconc})
|
||||
))
|
||||
})
|
||||
}), a(this).find("ul.ult_tabmenu li a.ult_a").click(function(b) {
|
||||
var c = a(this).closest(".ult_tabs"),
|
||||
j = a(this).closest("li.ult_tab_li").index();
|
||||
var p=a(this).parent().data("iconcolor");
|
||||
var icn=a(this).parent().data("iconhover");
|
||||
lastid.push(j);
|
||||
var current=lastid[lastid.length-1];
|
||||
var last=lastid[lastid.length-2];
|
||||
|
||||
//console.log("current-"+j);
|
||||
//console.log("last-"+last);
|
||||
var anm=a(this).closest('.ult_tabs').data("animation");
|
||||
|
||||
c.find("ul.ult_tabmenu > li.ult_tab_li").removeClass("current"), "style2" == d || "style1" == d ?( c.find("ul.ult_tabmenu > li.ult_tab_li").find("a").css({
|
||||
background: f,
|
||||
color: e
|
||||
}),
|
||||
c.find("ul.ult_tabmenu > li.ult_tab_li").find(".ult_tab_icon").css({
|
||||
color: p
|
||||
})) : (c.find("ul.ult_tabmenu > li.ult_tab_li").find("a.ult_a").css({
|
||||
color: e
|
||||
}), c.find("ul.ult_tabmenu > li.ult_tab_li").css({
|
||||
background: f,
|
||||
color: e
|
||||
})
|
||||
|
||||
);
|
||||
|
||||
var l = a(this).closest("li.ult_tab_li").addClass("current");
|
||||
|
||||
|
||||
if(anm =='Slide'){
|
||||
"style2" == d || "style1" == d ? (l.find("a.ult_a").css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),l.find(".ult_tab_icon").css({
|
||||
color: act_icon
|
||||
}) ): (l.find("a.ult_a").css({
|
||||
color: act_title
|
||||
}), l.css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}))
|
||||
,
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").stop().slideUp(500, function() {
|
||||
i > 0 && m();
|
||||
//console.log("prajakta");
|
||||
// var cnht=c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").outerHeight();
|
||||
//c.find(".ult_tabcontent").clearQueue().finish();
|
||||
//c.find(".ult_tabcontent").animate({height: cnht},300);
|
||||
}), c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").stop().slideDown(500, function(){
|
||||
}), k = j, b.preventDefault();
|
||||
}
|
||||
else if(anm =='Fade'){
|
||||
"style2" == d || "style1" == d ? (l.find("a.ult_a").css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),l.find(".ult_tab_icon").css({
|
||||
color: act_icon
|
||||
}) ): (l.find("a.ult_a").css({
|
||||
color: act_title
|
||||
}), l.css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}))
|
||||
,
|
||||
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").fadeOut(100, function() {
|
||||
i > 0 && m();
|
||||
|
||||
|
||||
}), c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").fadeIn(1200), k = j, b.preventDefault();
|
||||
|
||||
}
|
||||
else if(anm =='Scale'){
|
||||
//alert("hi");
|
||||
"style2" == d || "style1" == d ? (l.find("a.ult_a").css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),l.find(".ult_tab_icon").css({
|
||||
color: act_icon
|
||||
}) ): (l.find("a.ult_a").css({
|
||||
color: act_title
|
||||
}), l.css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}))
|
||||
,
|
||||
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").fadeOut(100, function() {
|
||||
i > 0 && m();
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").addClass("scaleTabname");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").removeClass("scaleTabname2");
|
||||
|
||||
}), c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").fadeIn(300,function(){
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").removeClass("scaleTabname");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").addClass("scaleTabname2");
|
||||
|
||||
}), k = j, b.preventDefault();
|
||||
|
||||
}
|
||||
else if(anm =='Slide-Zoom'){
|
||||
|
||||
"style2" == d || "style1" == d ? (l.find("a.ult_a").css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),l.find(".ult_tab_icon").css({
|
||||
color: act_icon
|
||||
}) ): (l.find("a.ult_a").css({
|
||||
color: act_title
|
||||
}), l.css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}))
|
||||
,
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").removeClass("ult_owl-backSlide-in");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").removeClass("ult_owl-backSlide-out");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").removeClass("ult_owl-backSlideright-in");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").removeClass("ult_owl-backSlideright-out");
|
||||
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").fadeOut(200, function() {
|
||||
c.find(".ult_tabcontent").find("div.ult_tab_min_contain").addClass("ult_owl-origin");
|
||||
if(j<last){
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").addClass("ult_owl-backSlide-in");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").removeClass(" ult_owl-backSlide-out");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + last + ")").addClass("ult_owl-backSlide-out");
|
||||
}
|
||||
else{
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").addClass("ult_owl-backSlideright-in");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").removeClass(" ult_owl-backSlideright-out");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + last + ")").addClass("ult_owl-backSlideright-out");
|
||||
}
|
||||
i > 0 && m();
|
||||
|
||||
}),
|
||||
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").fadeIn(1500,function(){
|
||||
c.find(".ult_tabcontent").find("div.ult_tab_min_contain").removeClass("ult_owl-origin");
|
||||
if(j<last){
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + last + ")").removeClass(" ult_owl-backSlide-in");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").removeClass(" ult_owl-backSlide-out");
|
||||
}
|
||||
else{
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + last + ")").removeClass(" ult_owl-backSlideright-in");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").removeClass(" ult_owl-backSlideright-out");
|
||||
|
||||
}
|
||||
}), k = j, b.preventDefault();
|
||||
|
||||
|
||||
}
|
||||
else if(anm =='Slide-Horizontal'){
|
||||
"style2" == d || "style1" == d ? (l.find("a.ult_a").css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),l.find(".ult_tab_icon").css({
|
||||
color: act_icon
|
||||
}) ): (l.find("a.ult_a").css({
|
||||
color: act_title
|
||||
}), l.css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}))
|
||||
,
|
||||
p=c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").hasClass("ult_active_tabnme");
|
||||
if(p==false){
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").hide(10, function() {
|
||||
jQuery(this).addClass("ult_active_tabnme");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").removeClass("ult_active_tabnme");
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").hide(10);
|
||||
|
||||
if(j>last){
|
||||
jQuery(this).animate({left:"-"+ht_width+"px"},10);
|
||||
//c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + last + ")").animate({left:"-"+ht_width+"px"},10);
|
||||
}else{
|
||||
jQuery(this).animate({left:""+ht_width+"px"},10);
|
||||
//c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + last + ")").animate({left:""+ht_width+"px"},10);
|
||||
|
||||
}
|
||||
i > 0 && m()
|
||||
}), c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").show(100,function(){
|
||||
jQuery(this).animate({left:"0px"},800)
|
||||
}), k = j, b.preventDefault();
|
||||
|
||||
}else{
|
||||
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").animate({opacity: 1}, 1, function() {
|
||||
i > 0 && m()
|
||||
}), c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").animate({opacity: 1}, 1,function(){
|
||||
}), k = j, b.preventDefault();
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
"style2" == d || "style1" == d ? (l.find("a.ult_a").css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}),l.find(".ult_tab_icon").css({
|
||||
color: act_icon
|
||||
}) ): (l.find("a.ult_a").css({
|
||||
color: act_title
|
||||
}), l.css({
|
||||
background: act_bg,
|
||||
color: act_title
|
||||
}))
|
||||
,
|
||||
|
||||
c.find(".ult_tabcontent").find("div.ult_tabitemname").not("div.ult_tabitemname:eq(" + j + ")").hide(1, function() {
|
||||
i > 0 && m()
|
||||
}), c.find(".ult_tabcontent").find("div.ult_tabitemname:eq(" + j + ")").show(10), k = j, b.preventDefault();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
var l = 0;
|
||||
i > 0 && m()
|
||||
})
|
||||
});
|
||||
|
||||
/*--- for height matching ----*/
|
||||
jQuery(document).ready(function(a) {
|
||||
|
||||
//for icon color changes on click event
|
||||
a(this).find("ul.ult_tabmenu li a.ult_a").click(function(b) {
|
||||
|
||||
a(this).closest("li.ult_tab_li").siblings().each(function(index,value){
|
||||
var iconcolor=a(this).data('iconcolor');
|
||||
a(this).find(".ult_tab_icon").css({color: iconcolor});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function setmytime( string ,float_val ){
|
||||
|
||||
var arr=[];
|
||||
var newarr=[];
|
||||
var flag=true;
|
||||
var styleflag=true;
|
||||
//for link and to tab
|
||||
var type = escape( window.location.hash.substr(1) );
|
||||
if(string!='' && typeof string!='undefined'){
|
||||
type = string ;
|
||||
}
|
||||
if(type!='')
|
||||
{
|
||||
var maintab=jQuery("a.ult_a[href$='"+type+"']");
|
||||
if(maintab.parents(".ult_tabs").length > 0)
|
||||
{
|
||||
var bgcontain= maintab.parents(".ult_tabs");
|
||||
var actbgcolor=bgcontain.data('activebg');
|
||||
var normbgcolor=bgcontain.data('titlebg');
|
||||
var titlecolor=bgcontain.data('titlecolor');
|
||||
var activetitle=bgcontain.data('activetitle');
|
||||
var tabsstyle=bgcontain.data('tabsstyle');
|
||||
|
||||
var aciveicon=bgcontain.data('activeicon');
|
||||
var iconcolor=bgcontain.find("li.ult_tab_li").data('iconcolor');
|
||||
if(aciveicon==''){
|
||||
var aciveicon=bgcontain.find("li.ult_tab_li").data('iconhover');
|
||||
}
|
||||
bgcontain.find("li.ult_tab_li").removeClass("current");
|
||||
if(maintab.hasClass('ult_a')){
|
||||
maintab.parent().addClass("current");
|
||||
}
|
||||
|
||||
if(tabsstyle=='style1'||tabsstyle=='style2'){
|
||||
bgcontain.find("a.ult_a").css({'background-color':normbgcolor});
|
||||
maintab.css({'background-color':actbgcolor});
|
||||
}else{
|
||||
bgcontain.find("li.ult_tab_li").css({'background-color':normbgcolor});
|
||||
maintab.parent().css({'background-color':actbgcolor});
|
||||
//maintab.css({'background-color':normbgcolor});
|
||||
}
|
||||
bgcontain.find("a.ult_a").css({'color':titlecolor});
|
||||
|
||||
maintab.css({'color':activetitle});
|
||||
|
||||
bgcontain.find(".ult_tab_icon").css({'color':iconcolor});
|
||||
maintab.find(".ult_tab_icon").css({'color':aciveicon});
|
||||
|
||||
var index=maintab.parent().index()+1;
|
||||
bgcontain.find(".ult_tabcontent" ).css({'display':'block'});
|
||||
bgcontain.find(".ult_tabitemname" ).css({'display':'none'});
|
||||
bgcontain.find(".ult_tabitemname:nth-child("+index+")" ).css({'display':'block'});
|
||||
jQuery(document).trigger('ultAdvancedTabClickedDualBtn', bgcontain.find(".ult_tabitemname:nth-child("+index+")" ) );
|
||||
|
||||
var off = bgcontain.offset().top;
|
||||
var left = bgcontain.offset().left;
|
||||
|
||||
bgcontain.addClass('ult_aniamte');
|
||||
|
||||
bgcontain.find("ul.ult_tabmenu li a.ult_a").click(function(b) {
|
||||
b.preventDefault();
|
||||
jQuery("html,body").clearQueue();
|
||||
jQuery("html,body").stop();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(".ult_tabs").each(function() {
|
||||
//for fullheight
|
||||
var fullheight=jQuery(this).data('fullheight');
|
||||
var mheight=0;
|
||||
if(fullheight=='on'){
|
||||
jQuery(this).find('.ult_tabitemname').each(function(){
|
||||
if (mheight < jQuery(this).outerHeight()) {
|
||||
mheight = jQuery(this).outerHeight();
|
||||
|
||||
jQuery(this).parents(".ult_tabcontent").css({"min-height":mheight+"px"});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var style=jQuery(this).data('tabsstyle');
|
||||
var width=jQuery( window ).width();
|
||||
var responsemode=jQuery(this).data('respmode');
|
||||
var respwidth=jQuery(this).data('respwidth');
|
||||
var showboth=jQuery(this).data('responsivemode');
|
||||
var animt=jQuery(this).closest('.ult_tabs').data("animation");
|
||||
|
||||
// if(animt=='Fade'|| animt =='Scale' || animt=='Slide-Zoom'){
|
||||
// var cnwidth=jQuery(this).find("div.ult_tabcontent").outerHeight();
|
||||
// jQuery(this).find('.ult_tabcontent').css({'height':cnwidth});
|
||||
// }
|
||||
|
||||
if(animt=='Slide-Horizontal'){
|
||||
var width=jQuery(this).find('div.ult_tabcontent').outerWidth();
|
||||
//jQuery(this).find('.ult_tabitemname').not("div.ult_tabitemname:eq(0)").css({left:"-"+width+"px"});
|
||||
jQuery(this).find(".ult_tabcontent").find("div.ult_tabitemname:eq(0)").addClass("ult_active_tabnme");
|
||||
}
|
||||
|
||||
if(animt=='Scale'){
|
||||
jQuery(this).find('.ult_tabitemname').not("div.ult_tabitemname:eq(0)").addClass("scaleTabname");
|
||||
jQuery(this).find(".ult_tabcontent").find("div.ult_tabitemname:eq(0)").addClass("scaleTabname2");
|
||||
}
|
||||
|
||||
if(animt=='Slide-Zoom'){
|
||||
jQuery(this).closest(".ult_tabs").find("div.ult_tabitemname").removeClass("owl-backSlide-in");
|
||||
jQuery(this).closest(".ult_tabs").find("div.ult_tabitemname").removeClass("owl-backSlide-in");
|
||||
}
|
||||
var id = jQuery(this).attr('id');
|
||||
if(width>=respwidth){
|
||||
/*jQuery(this).parent().find(".ult_acord").css({display:"none"});
|
||||
jQuery(this).parent().find(".ult_tabs").css({display:"block"});*/
|
||||
// here - .id => accordian and #id =>Tab
|
||||
jQuery(this).parent().find("."+id).css({display:"none"});
|
||||
jQuery(this).parent().find("#"+id).css({display:"block"});
|
||||
}
|
||||
else{
|
||||
if(responsemode=='Accordion'){
|
||||
jQuery(this).parent().find("."+id).css({display:"block"});
|
||||
jQuery(this).parent().find("#"+id).css({display:"none"});
|
||||
}
|
||||
}
|
||||
|
||||
var maxheight = 0;
|
||||
flag='false';
|
||||
jQuery(this).find('.ult_tab_li').each(function(){
|
||||
if (maxheight < jQuery(this).outerHeight()) {
|
||||
maxheight = jQuery(this).outerHeight();
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(this).find('.ult_a').addClass(flag);
|
||||
ht1=parseInt(maxheight);
|
||||
|
||||
if(style=='style2'){
|
||||
ht1=parseInt(ht1/2);
|
||||
if(width>300 && width <660)
|
||||
{
|
||||
ht1=maxheight/2;
|
||||
}
|
||||
}
|
||||
|
||||
if(width>300 && width <660)
|
||||
{
|
||||
jQuery(this).find('.ult_a ').removeClass("false");
|
||||
newarr.push(ht1);
|
||||
if(showboth!='Both'){
|
||||
if(jQuery(this).find('.aio-icon').hasClass('icon-top')){
|
||||
jQuery(this).find('.aio-icon').removeClass('icon-top').addClass('ult_tab_resp_icon');
|
||||
}
|
||||
if(jQuery(this).find('.ult_tab_main').hasClass('ult_top')){
|
||||
jQuery(this).find('.ult_tab_main').removeClass('ult_top').addClass('ult_tab_resp_ult_top');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(jQuery(this).find('.ult_a ').hasClass("false")){
|
||||
arr.push(ht1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function setht(){
|
||||
var width=jQuery( window ).width();
|
||||
jQuery(".ult_tabs").each(function() {
|
||||
|
||||
var style=jQuery(this).data('tabsstyle');
|
||||
var responsemode=jQuery(this).data('respmode');
|
||||
var respwidth=jQuery(this).data('respwidth');
|
||||
var showboth=jQuery(this).data('responsivemode');
|
||||
var id = jQuery(this).attr('id');
|
||||
if(width>=respwidth){
|
||||
/*jQuery(this).parent().find(".ult_acord").css({display:"none"});
|
||||
jQuery(this).parent().find(".ult_tabs").css({display:"block"});*/
|
||||
|
||||
jQuery(this).parent().find("."+id).css({display:"none"});
|
||||
jQuery(this).parent().find("#"+id).css({display:"block"});
|
||||
|
||||
if(showboth!='Both'){
|
||||
if(jQuery(this).find('.aio-icon').hasClass('ult_tab_resp_icon')){
|
||||
jQuery(this).find('.aio-icon').removeClass('ult_tab_resp_icon').addClass('icon-top');
|
||||
}
|
||||
if(jQuery(this).find('.ult_tab_main').hasClass('ult_tab_resp_ult_top')){
|
||||
jQuery(this).find('.ult_tab_main').removeClass('ult_tab_resp_ult_top').addClass('ult_top');
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(responsemode=='Accordion'){
|
||||
jQuery(this).parent().find("."+id).css({display:"block"});
|
||||
jQuery(this).parent().find("#"+id).css({display:"none"});
|
||||
}
|
||||
if(showboth!='Both'){
|
||||
if(jQuery(this).find('.aio-icon').hasClass('icon-top')){
|
||||
jQuery(this).find('.aio-icon').removeClass('icon-top').addClass('ult_tab_resp_icon');
|
||||
}
|
||||
if(jQuery(this).find('.ult_tab_main').hasClass('ult_top')){
|
||||
jQuery(this).find('.ult_tab_main').removeClass('ult_top').addClass('ult_tab_resp_ult_top');
|
||||
}
|
||||
}
|
||||
}
|
||||
if(width>300 && width <660)
|
||||
{
|
||||
jQuery(this).find('.ult_a ').removeClass("false");
|
||||
newarr.push(ht1);
|
||||
if(showboth!='Both'){
|
||||
if(jQuery(this).find('.aio-icon').hasClass('icon-top')){
|
||||
jQuery(this).find('.aio-icon').removeClass('icon-top').addClass('ult_tab_resp_icon');
|
||||
}
|
||||
if(jQuery(this).find('.ult_tab_main').hasClass('ult_top')){
|
||||
jQuery(this).find('.ult_tab_main').removeClass('ult_top').addClass('ult_tab_resp_ult_top');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
jQuery(window).resize(function(e){
|
||||
setht();// call setmytime function to active any link on click of a tag or menu
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
//setmytime();// call setmytime function to active any link from other pages click of a tag or menu
|
||||
|
||||
// call setmytime function to active any tab on click of menu
|
||||
jQuery(this).find("a").click(function(b) {
|
||||
var href= jQuery(this).attr("href");
|
||||
if( typeof href !== 'undefined' && href.length > 0 ){
|
||||
var type = escape(href.substring(href.indexOf('#')+1));
|
||||
var maintab=jQuery("a.ult_a[href$='"+type+"']");
|
||||
var tabid = maintab.attr('href');
|
||||
if( typeof tabid!='undefined' && tabid !== '' ){
|
||||
tabid = tabid.replace("#", "");
|
||||
}
|
||||
if(maintab.parents(".ult_tabs").length > 0 && type == tabid )
|
||||
{
|
||||
setmytime(tabid);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//set tab active initially
|
||||
jQuery(".ult_tabs").each(function() {
|
||||
var Cur_URL = window.location.href;
|
||||
var URL_ID = Cur_URL.substr(Cur_URL.indexOf("#") + 1);
|
||||
//for fullheight
|
||||
var indexOf=jQuery(this).data('activeindex');
|
||||
if( indexOf == '' && indexOf != '0' )
|
||||
{
|
||||
indexOf = 1;
|
||||
}
|
||||
var p = jQuery(this).find("ul.ult_tabmenu li.ult_tab_li:nth-child("+indexOf+")" ).find(".ult_a").attr("id");
|
||||
|
||||
if(URL_ID !== Cur_URL) {
|
||||
p = URL_ID;
|
||||
}
|
||||
if(typeof p !== "undefined") {
|
||||
if(p.length >= 1 && indexOf >= 1){
|
||||
setmytime(p ,true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
jQuery(this).find(".ult_tabcontent" ).css({'display':'none'});
|
||||
}
|
||||
});
|
||||
|
||||
/*--- for smooth fadein effect ------*/
|
||||
jQuery(this).find("ul.ult_tabmenu li a.ult_a").click(function(b) {
|
||||
|
||||
var animt=jQuery(this).closest('.ult_tabs').data("animation");
|
||||
j = jQuery(this).closest("li.ult_tab_li").index();
|
||||
|
||||
if(animt =='Fade' ){
|
||||
var cwidth=jQuery(this).closest(".ult_tabs").find("div.ult_tabitemname:eq(" + j + ")").outerHeight();
|
||||
jQuery(this).closest(".ult_tabs").find(".ult_tabitemname").css({'position':"absolute","left":"0","right":"0"});
|
||||
// jQuery(this).closest(".ult_tabs").find('.ult_tabcontent').css({'height':cwidth});
|
||||
jQuery(this).closest(".ult_tabs").find('.ult_tabcontent').animate({'height':cwidth},"slow");
|
||||
}
|
||||
|
||||
if(animt =='Slide-Horizontal' ){
|
||||
var cwidth=jQuery(this).closest(".ult_tabs").find("div.ult_tabitemname:eq(" + j + ")").outerHeight();
|
||||
jQuery(this).closest(".ult_tabs").find(".ult_tabcontent").css({"overflow":"hidden"});
|
||||
jQuery(this).closest(".ult_tabs").find('.ult_tabcontent').animate({'height':cwidth},"slow");
|
||||
}
|
||||
var tab_content_class=jQuery(this).closest(".ult_tabs").find("div.ult_tabitemname:eq(" + j + ")");
|
||||
jQuery(document).trigger('ultAdvancedTabClickedCarousel', tab_content_class );
|
||||
jQuery(document).trigger('ultAdvancedTabClickedDualBtn', tab_content_class );
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
/*--- for advancedcarousal ------*/
|
||||
|
||||
jQuery(this).find("ul.ult_tabmenu li a.ult_a").click(function(b) {
|
||||
if(jQuery(".slick-slider").parents('.ult_tabitemname').length){
|
||||
setTimeout(function(){
|
||||
jQuery('.slick-slider').slick('setPosition');
|
||||
jQuery(window).trigger('resize');
|
||||
},200);
|
||||
}
|
||||
});
|
||||
|
||||
//for toggle
|
||||
if(jQuery(".vc_toggle").parents('.ult_tabs')){
|
||||
|
||||
jQuery( ".vc_toggle" ).click(function() {
|
||||
var prev_ht= jQuery(this).parents(".ult_tabitemname").height();
|
||||
|
||||
jQuery(this).find(".vc_toggle_content").toggleClass("vc_toggle_for_tab");
|
||||
|
||||
if(jQuery(this).find(".vc_toggle_content").hasClass("vc_toggle_for_tab")){
|
||||
setTimeout(function(){
|
||||
var tab_ht= jQuery(".ult_tabitemname").height();
|
||||
jQuery('.ult_tabcontent').animate({'height':tab_ht},100);
|
||||
|
||||
},100);
|
||||
}else{
|
||||
setTimeout(function(){
|
||||
var tab_ht= jQuery(".vc_toggle").parents('.ult_tabitemname').height();
|
||||
jQuery('.ult_tabcontent').animate({'height':tab_ht},100);
|
||||
},200);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,123 @@
|
||||
jQuery(document).ready(function(){
|
||||
jQuery('.ult-team.ult-social-icon').hover(function(){
|
||||
|
||||
var icon_color = jQuery(this).data('iconcolor');
|
||||
var icon_hover = jQuery(this).data('iconhover');
|
||||
|
||||
if( icon_hover != 'inherit' ) {
|
||||
jQuery( this ).css( "color", icon_hover );
|
||||
}
|
||||
else {
|
||||
jQuery( this ).css( "color", '' );
|
||||
}
|
||||
|
||||
}, function(){
|
||||
|
||||
var icon_color = jQuery(this).data('iconcolor');
|
||||
var icon_hover = jQuery(this).data('iconhover');
|
||||
|
||||
if( icon_color != 'inherit' ) {
|
||||
jQuery( this ).css( "color", icon_color );
|
||||
}
|
||||
else {
|
||||
jQuery( this ).css( "color", '' );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery(".ult-style-2").hover(function(){
|
||||
|
||||
var self = jQuery(this).find(' .ult-team-member-image').first();
|
||||
var hover_opacity = self.data('hover_opacity');
|
||||
self.children('img').css( "opacity", hover_opacity );
|
||||
|
||||
}, function(){
|
||||
|
||||
var self = jQuery(this).find(' .ult-team-member-image').first();
|
||||
var opacity = self.data('opacity');
|
||||
self.children('img').css( "opacity", opacity );
|
||||
|
||||
});
|
||||
|
||||
jQuery(".ult-style-3").hover(function(){
|
||||
var self = jQuery(this).find(' .ult-team-member-image').first();
|
||||
var hover_opacity = self.data('hover_opacity');
|
||||
self.find('img').css( "opacity", hover_opacity );
|
||||
|
||||
}, function(){
|
||||
|
||||
var self = jQuery(this).find(' .ult-team-member-image').first();
|
||||
self.find('img').css( "opacity", 1 );
|
||||
|
||||
});
|
||||
|
||||
function Ult_ResponsiveStyle() {
|
||||
jQuery('.ult-team-member-wrap').each(function(i){
|
||||
var r_width = jQuery(this).data('responsive_width');
|
||||
|
||||
if(r_width != '') {
|
||||
|
||||
if ( jQuery(window).width() <= r_width ) {
|
||||
jQuery(this).removeClass('ult-style-2');
|
||||
jQuery(this).addClass('ult-style-1 ult-responsive');
|
||||
}
|
||||
else {
|
||||
if( jQuery(this).hasClass('ult-responsive') ) {
|
||||
jQuery(this).removeClass('ult-style-1 ult-responsive');
|
||||
jQuery(this).addClass('ult-style-2');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function set_Top_Description() {
|
||||
jQuery('.ult-team-member-wrap').each(function(i) {
|
||||
var p_height = jQuery(this).height();
|
||||
var child_height = jQuery(this).find('.ult-team_description_slide');
|
||||
var desc_element = child_height; // jQuery(child_height[0]);
|
||||
|
||||
if( parseFloat(p_height) < parseFloat(desc_element.height()) ) {
|
||||
|
||||
desc_element.addClass('ult-desc-set-top');
|
||||
} else {
|
||||
if( desc_element.hasClass('ult-desc-set-top') ) {
|
||||
desc_element.removeClass('ult-desc-set-top');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.ult-style-3 .ult-team-member-image').each(function(i) {
|
||||
|
||||
var p_height = jQuery(this).height();
|
||||
var child_height = jQuery(this).find('.ult-team-member-description');
|
||||
var desc_element = child_height; // jQuery(child_height[0]);
|
||||
|
||||
if( parseFloat(p_height) < parseFloat(desc_element.height()) ) {
|
||||
desc_element.addClass('ult-desc-set-top');
|
||||
} else {
|
||||
if( desc_element.hasClass('ult-desc-set-top') ) {
|
||||
desc_element.removeClass('ult-desc-set-top');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Ult_ResponsiveStyle();
|
||||
|
||||
setTimeout(set_Top_Description, 500);
|
||||
|
||||
jQuery('.ult-team-member-wrap .ult-team-member-image img').load(function(){
|
||||
set_Top_Description();
|
||||
});
|
||||
|
||||
jQuery(window).resize(function(){
|
||||
Ult_ResponsiveStyle();
|
||||
set_Top_Description();
|
||||
});
|
||||
|
||||
jQuery('.ult-team-member-image-overlay.ult-team_img_hover').each(function(){
|
||||
var bg_color = jQuery(this).data('background_clr');
|
||||
jQuery(this).css( { "background-color" : bg_color } );
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,301 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: bsf_tooltip.js v3.1.1
|
||||
* http://getbootstrap.com/javascript/#bsf_tooltip
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
+function ($) {
|
||||
'use strict';
|
||||
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||
// ===============================
|
||||
var Tooltip = function (element, options) {
|
||||
this.type =
|
||||
this.options =
|
||||
this.enabled =
|
||||
this.timeout =
|
||||
this.hoverState =
|
||||
this.$element = null
|
||||
this.init('bsf_tooltip', element, options)
|
||||
}
|
||||
Tooltip.DEFAULTS = {
|
||||
animation: true,
|
||||
placement: 'top',
|
||||
selector: false,
|
||||
template: '<div class="bsf_tooltip"><div class="bsf_tooltip-arrow"></div><div class="bsf_tooltip-inner"></div></div>',
|
||||
trigger: 'hover focus',
|
||||
title: '',
|
||||
delay: 0,
|
||||
html: false,
|
||||
container: false
|
||||
}
|
||||
Tooltip.prototype.init = function (type, element, options) {
|
||||
this.enabled = true
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
var triggers = this.options.trigger.split(' ')
|
||||
for (var i = triggers.length; i--;) {
|
||||
var trigger = triggers[i]
|
||||
if (trigger == 'click') {
|
||||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||
} else if (trigger != 'manual') {
|
||||
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
||||
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
}
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
Tooltip.prototype.getDefaults = function () {
|
||||
return Tooltip.DEFAULTS
|
||||
}
|
||||
Tooltip.prototype.getOptions = function (options) {
|
||||
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
show: options.delay,
|
||||
hide: options.delay
|
||||
}
|
||||
}
|
||||
return options
|
||||
}
|
||||
Tooltip.prototype.getDelegateOptions = function () {
|
||||
var options = {}
|
||||
var defaults = this.getDefaults()
|
||||
this._options && $.each(this._options, function (key, value) {
|
||||
if (defaults[key] != value) options[key] = value
|
||||
})
|
||||
return options
|
||||
}
|
||||
Tooltip.prototype.enter = function (obj) {
|
||||
var self = obj instanceof this.constructor ?
|
||||
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
||||
clearTimeout(self.timeout)
|
||||
self.hoverState = 'in'
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
self.timeout = setTimeout(function () {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
Tooltip.prototype.leave = function (obj) {
|
||||
var self = obj instanceof this.constructor ?
|
||||
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
||||
clearTimeout(self.timeout)
|
||||
self.hoverState = 'out'
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
self.timeout = setTimeout(function () {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
Tooltip.prototype.show = function () {
|
||||
var e = $.Event('show.bs.' + this.type)
|
||||
if (this.hasContent() && this.enabled) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
var that = this;
|
||||
var $tip = this.tip()
|
||||
this.setContent()
|
||||
if (this.options.animation) $tip.addClass('fade')
|
||||
var placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement
|
||||
var autoToken = /\s?auto?\s?/i
|
||||
var autoPlace = autoToken.test(placement)
|
||||
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
||||
$tip
|
||||
.detach()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
.addClass(placement)
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
var pos = this.getPosition()
|
||||
var actualWidth = $tip[0].offsetWidth
|
||||
var actualHeight = $tip[0].offsetHeight
|
||||
if (autoPlace) {
|
||||
var $parent = this.$element.parent()
|
||||
var orgPlacement = placement
|
||||
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
|
||||
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
|
||||
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
|
||||
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
|
||||
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
|
||||
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
|
||||
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
|
||||
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
|
||||
placement
|
||||
$tip
|
||||
.removeClass(orgPlacement)
|
||||
.addClass(placement)
|
||||
}
|
||||
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
||||
this.applyPlacement(calculatedOffset, placement)
|
||||
this.hoverState = null
|
||||
var complete = function() {
|
||||
that.$element.trigger('shown.bs.' + that.type)
|
||||
}
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
$tip
|
||||
.one($.support.transition.end, complete)
|
||||
.emulateTransitionEnd(150) :
|
||||
complete()
|
||||
}
|
||||
}
|
||||
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
||||
var replace
|
||||
var $tip = this.tip()
|
||||
var width = $tip[0].offsetWidth
|
||||
var height = $tip[0].offsetHeight
|
||||
// manually read margins because getBoundingClientRect includes difference
|
||||
var marginTop = parseInt($tip.css('margin-top'), 10)
|
||||
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
||||
// we must check for NaN for ie 8/9
|
||||
if (isNaN(marginTop)) marginTop = 0
|
||||
if (isNaN(marginLeft)) marginLeft = 0
|
||||
offset.top = offset.top + marginTop
|
||||
offset.left = offset.left + marginLeft
|
||||
// $.fn.offset doesn't round pixel values
|
||||
// so we use setOffset directly with our own function B-0
|
||||
$.offset.setOffset($tip[0], $.extend({
|
||||
using: function (props) {
|
||||
$tip.css({
|
||||
top: Math.round(props.top),
|
||||
left: Math.round(props.left)
|
||||
})
|
||||
}
|
||||
}, offset), 0)
|
||||
$tip.addClass('in')
|
||||
// check to see if placing tip in new offset caused the tip to resize itself
|
||||
var actualWidth = $tip[0].offsetWidth
|
||||
var actualHeight = $tip[0].offsetHeight
|
||||
if (placement == 'top' && actualHeight != height) {
|
||||
replace = true
|
||||
offset.top = offset.top + height - actualHeight
|
||||
}
|
||||
if (/bottom|top/.test(placement)) {
|
||||
var delta = 0
|
||||
if (offset.left < 0) {
|
||||
delta = offset.left * -2
|
||||
offset.left = 0
|
||||
$tip.offset(offset)
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
}
|
||||
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||
} else {
|
||||
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||
}
|
||||
if (replace) $tip.offset(offset)
|
||||
}
|
||||
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
|
||||
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
|
||||
}
|
||||
Tooltip.prototype.setContent = function () {
|
||||
var $tip = this.tip()
|
||||
var title = this.getTitle()
|
||||
$tip.find('.bsf_tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
Tooltip.prototype.hide = function () {
|
||||
var that = this
|
||||
var $tip = this.tip()
|
||||
var e = $.Event('hide.bs.' + this.type)
|
||||
function complete() {
|
||||
if (that.hoverState != 'in') $tip.detach()
|
||||
that.$element.trigger('hidden.bs.' + that.type)
|
||||
}
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$tip.removeClass('in')
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
$tip
|
||||
.one($.support.transition.end, complete)
|
||||
.emulateTransitionEnd(150) :
|
||||
complete()
|
||||
this.hoverState = null
|
||||
return this
|
||||
}
|
||||
Tooltip.prototype.fixTitle = function () {
|
||||
var $e = this.$element
|
||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||
}
|
||||
}
|
||||
Tooltip.prototype.hasContent = function () {
|
||||
return this.getTitle()
|
||||
}
|
||||
Tooltip.prototype.getPosition = function () {
|
||||
var el = this.$element[0]
|
||||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||
width: el.offsetWidth,
|
||||
height: el.offsetHeight
|
||||
}, this.$element.offset())
|
||||
}
|
||||
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
||||
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
||||
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
||||
}
|
||||
Tooltip.prototype.getTitle = function () {
|
||||
var title
|
||||
var $e = this.$element
|
||||
var o = this.options
|
||||
title = $e.attr('data-original-title')
|
||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||
return title
|
||||
}
|
||||
Tooltip.prototype.tip = function () {
|
||||
return this.$tip = this.$tip || $(this.options.template)
|
||||
}
|
||||
Tooltip.prototype.arrow = function () {
|
||||
return this.$arrow = this.$arrow || this.tip().find('.bsf_tooltip-arrow')
|
||||
}
|
||||
Tooltip.prototype.validate = function () {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide()
|
||||
this.$element = null
|
||||
this.options = null
|
||||
}
|
||||
}
|
||||
Tooltip.prototype.enable = function () {
|
||||
this.enabled = true
|
||||
}
|
||||
Tooltip.prototype.disable = function () {
|
||||
this.enabled = false
|
||||
}
|
||||
Tooltip.prototype.toggleEnabled = function () {
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
Tooltip.prototype.toggle = function (e) {
|
||||
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
|
||||
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||
}
|
||||
Tooltip.prototype.destroy = function () {
|
||||
clearTimeout(this.timeout)
|
||||
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
||||
}
|
||||
// TOOLTIP PLUGIN DEFINITION
|
||||
// =========================
|
||||
var old = $.fn.bsf_tooltip
|
||||
$.fn.bsf_tooltip = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.bsf_tooltip')
|
||||
var options = typeof option == 'object' && option
|
||||
if (!data && option == 'destroy') return
|
||||
if (!data) $this.data('bs.bsf_tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
$.fn.bsf_tooltip.Constructor = Tooltip
|
||||
// TOOLTIP NO CONFLICT
|
||||
// ===================
|
||||
$.fn.bsf_tooltip.noConflict = function () {
|
||||
$.fn.bsf_tooltip = old
|
||||
return this
|
||||
}
|
||||
}(jQuery);
|
||||
@@ -0,0 +1,438 @@
|
||||
// The MIT License (MIT)
|
||||
|
||||
// Typed.js | Copyright (c) 2016 Matt Boldt | www.mattboldt.com
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
|
||||
! function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var Typed = function(el, options) {
|
||||
|
||||
// chosen element to manipulate text
|
||||
this.el = $(el);
|
||||
|
||||
// options
|
||||
this.options = $.extend({}, $.fn.typed.defaults, options);
|
||||
|
||||
// attribute to type into
|
||||
this.isInput = this.el.is('input');
|
||||
this.attr = this.options.attr;
|
||||
|
||||
// show cursor
|
||||
this.showCursor = this.isInput ? false : this.options.showCursor;
|
||||
|
||||
// text content of element
|
||||
this.elContent = this.attr ? this.el.attr(this.attr) : this.el.text();
|
||||
|
||||
// html or plain text
|
||||
this.contentType = this.options.contentType;
|
||||
|
||||
// typing speed
|
||||
this.typeSpeed = this.options.typeSpeed;
|
||||
|
||||
// add a delay before typing starts
|
||||
this.startDelay = this.options.startDelay;
|
||||
|
||||
// backspacing speed
|
||||
this.backSpeed = this.options.backSpeed;
|
||||
|
||||
// amount of time to wait before backspacing
|
||||
this.backDelay = this.options.backDelay;
|
||||
|
||||
// div containing strings
|
||||
this.stringsElement = this.options.stringsElement;
|
||||
|
||||
// input strings of text
|
||||
this.strings = this.options.strings;
|
||||
|
||||
// character number position of current string
|
||||
this.strPos = 0;
|
||||
|
||||
// current array position
|
||||
this.arrayPos = 0;
|
||||
|
||||
// number to stop backspacing on.
|
||||
// default 0, can change depending on how many chars
|
||||
// you want to remove at the time
|
||||
this.stopNum = 0;
|
||||
|
||||
// Looping logic
|
||||
this.loop = this.options.loop;
|
||||
this.loopCount = this.options.loopCount;
|
||||
this.curLoop = 0;
|
||||
|
||||
// for stopping
|
||||
this.stop = false;
|
||||
|
||||
// custom cursor
|
||||
this.cursorChar = this.options.cursorChar;
|
||||
|
||||
// shuffle the strings
|
||||
this.shuffle = this.options.shuffle;
|
||||
// the order of strings
|
||||
this.sequence = [];
|
||||
|
||||
// All systems go!
|
||||
this.build();
|
||||
};
|
||||
|
||||
Typed.prototype = {
|
||||
|
||||
constructor: Typed,
|
||||
|
||||
init: function() {
|
||||
// begin the loop w/ first current string (global self.strings)
|
||||
// current string will be passed as an argument each time after this
|
||||
var self = this;
|
||||
self.timeout = setTimeout(function() {
|
||||
for (var i=0;i<self.strings.length;++i) self.sequence[i]=i;
|
||||
|
||||
// shuffle the array if true
|
||||
if(self.shuffle) self.sequence = self.shuffleArray(self.sequence);
|
||||
|
||||
// Start typing
|
||||
self.typewrite(self.strings[self.sequence[self.arrayPos]], self.strPos);
|
||||
}, self.startDelay);
|
||||
},
|
||||
|
||||
build: function() {
|
||||
var self = this;
|
||||
// Insert cursor
|
||||
if (this.showCursor === true) {
|
||||
this.cursor = $("<span class=\"typed-cursor\">" + this.cursorChar + "</span>");
|
||||
this.el.after(this.cursor);
|
||||
}
|
||||
if (this.stringsElement) {
|
||||
this.strings = [];
|
||||
this.stringsElement.hide();
|
||||
console.log(this.stringsElement.children());
|
||||
var strings = this.stringsElement.children();
|
||||
$.each(strings, function(key, value){
|
||||
self.strings.push($(value).html());
|
||||
});
|
||||
}
|
||||
this.init();
|
||||
},
|
||||
|
||||
// pass current string state to each function, types 1 char per call
|
||||
typewrite: function(curString, curStrPos) {
|
||||
// exit when stopped
|
||||
if (this.stop === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
// varying values for setTimeout during typing
|
||||
// can't be global since number changes each time loop is executed
|
||||
var humanize = Math.round(Math.random() * (100 - 30)) + this.typeSpeed;
|
||||
var self = this;
|
||||
|
||||
// ------------- optional ------------- //
|
||||
// backpaces a certain string faster
|
||||
// ------------------------------------ //
|
||||
// if (self.arrayPos == 1){
|
||||
// self.backDelay = 50;
|
||||
// }
|
||||
// else{ self.backDelay = 500; }
|
||||
|
||||
// contain typing function in a timeout humanize'd delay
|
||||
self.timeout = setTimeout(function() {
|
||||
// check for an escape character before a pause value
|
||||
// format: \^\d+ .. eg: ^1000 .. should be able to print the ^ too using ^^
|
||||
// single ^ are removed from string
|
||||
var charPause = 0;
|
||||
var substr = curString.substr(curStrPos);
|
||||
if (substr.charAt(0) === '^') {
|
||||
var skip = 1; // skip atleast 1
|
||||
if (/^\^\d+/.test(substr)) {
|
||||
substr = /\d+/.exec(substr)[0];
|
||||
skip += substr.length;
|
||||
charPause = parseInt(substr);
|
||||
}
|
||||
|
||||
// strip out the escape character and pause value so they're not printed
|
||||
curString = curString.substring(0, curStrPos) + curString.substring(curStrPos + skip);
|
||||
}
|
||||
|
||||
if (self.contentType === 'html') {
|
||||
// skip over html tags while typing
|
||||
var curChar = curString.substr(curStrPos).charAt(0)
|
||||
if (curChar === '<') {
|
||||
var tag = '';
|
||||
var endTag = '';
|
||||
if (curChar === '<') {
|
||||
endTag = '>'
|
||||
}
|
||||
else {
|
||||
endTag = ';'
|
||||
}
|
||||
while (curString.substr(curStrPos + 1).charAt(0) !== endTag) {
|
||||
tag += curString.substr(curStrPos).charAt(0);
|
||||
curStrPos++;
|
||||
if (curStrPos + 1 > curString.length) { break; }
|
||||
}
|
||||
curStrPos++;
|
||||
tag += endTag;
|
||||
}
|
||||
}
|
||||
|
||||
// timeout for any pause after a character
|
||||
self.timeout = setTimeout(function() {
|
||||
if (curStrPos === curString.length) {
|
||||
// fires callback function
|
||||
self.options.onStringTyped(self.arrayPos);
|
||||
|
||||
// is this the final string
|
||||
if (self.arrayPos === self.strings.length - 1) {
|
||||
// animation that occurs on the last typed string
|
||||
self.options.callback();
|
||||
|
||||
self.curLoop++;
|
||||
|
||||
// quit if we wont loop back
|
||||
if (self.loop === false || self.curLoop === self.loopCount)
|
||||
return;
|
||||
}
|
||||
|
||||
self.timeout = setTimeout(function() {
|
||||
self.backspace(curString, curStrPos);
|
||||
}, self.backDelay);
|
||||
|
||||
} else {
|
||||
|
||||
/* call before functions if applicable */
|
||||
if (curStrPos === 0) {
|
||||
self.options.preStringTyped(self.arrayPos);
|
||||
}
|
||||
|
||||
// start typing each new char into existing string
|
||||
// curString: arg, self.el.html: original text inside element
|
||||
var nextString = curString.substr(0, curStrPos + 1);
|
||||
if (self.attr) {
|
||||
self.el.attr(self.attr, nextString);
|
||||
} else {
|
||||
if (self.isInput) {
|
||||
self.el.val(nextString);
|
||||
} else if (self.contentType === 'html') {
|
||||
self.el.html(nextString);
|
||||
} else {
|
||||
self.el.text(nextString);
|
||||
}
|
||||
}
|
||||
|
||||
// add characters one by one
|
||||
curStrPos++;
|
||||
// loop the function
|
||||
self.typewrite(curString, curStrPos);
|
||||
}
|
||||
// end of character pause
|
||||
}, charPause);
|
||||
|
||||
// humanized value for typing
|
||||
}, humanize);
|
||||
|
||||
},
|
||||
|
||||
backspace: function(curString, curStrPos) {
|
||||
// exit when stopped
|
||||
if (this.stop === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
// varying values for setTimeout during typing
|
||||
// can't be global since number changes each time loop is executed
|
||||
var humanize = Math.round(Math.random() * (100 - 30)) + this.backSpeed;
|
||||
var self = this;
|
||||
|
||||
self.timeout = setTimeout(function() {
|
||||
|
||||
// ----- this part is optional ----- //
|
||||
// check string array position
|
||||
// on the first string, only delete one word
|
||||
// the stopNum actually represents the amount of chars to
|
||||
// keep in the current string. In my case it's 14.
|
||||
// if (self.arrayPos == 1){
|
||||
// self.stopNum = 14;
|
||||
// }
|
||||
//every other time, delete the whole typed string
|
||||
// else{
|
||||
// self.stopNum = 0;
|
||||
// }
|
||||
|
||||
if (self.contentType === 'html') {
|
||||
// skip over html tags while backspacing
|
||||
if (curString.substr(curStrPos).charAt(0) === '>') {
|
||||
var tag = '';
|
||||
while (curString.substr(curStrPos - 1).charAt(0) !== '<') {
|
||||
tag -= curString.substr(curStrPos).charAt(0);
|
||||
curStrPos--;
|
||||
if (curStrPos < 0) { break; }
|
||||
}
|
||||
curStrPos--;
|
||||
tag += '<';
|
||||
}
|
||||
}
|
||||
|
||||
// ----- continue important stuff ----- //
|
||||
// replace text with base text + typed characters
|
||||
var nextString = curString.substr(0, curStrPos);
|
||||
if (self.attr) {
|
||||
self.el.attr(self.attr, nextString);
|
||||
} else {
|
||||
if (self.isInput) {
|
||||
self.el.val(nextString);
|
||||
} else if (self.contentType === 'html') {
|
||||
self.el.html(nextString);
|
||||
} else {
|
||||
self.el.text(nextString);
|
||||
}
|
||||
}
|
||||
|
||||
// if the number (id of character in current string) is
|
||||
// less than the stop number, keep going
|
||||
if (curStrPos > self.stopNum) {
|
||||
// subtract characters one by one
|
||||
curStrPos--;
|
||||
// loop the function
|
||||
self.backspace(curString, curStrPos);
|
||||
}
|
||||
// if the stop number has been reached, increase
|
||||
// array position to next string
|
||||
else if (curStrPos <= self.stopNum) {
|
||||
self.arrayPos++;
|
||||
|
||||
if (self.arrayPos === self.strings.length) {
|
||||
self.arrayPos = 0;
|
||||
|
||||
// Shuffle sequence again
|
||||
if(self.shuffle) self.sequence = self.shuffleArray(self.sequence);
|
||||
|
||||
self.init();
|
||||
} else
|
||||
self.typewrite(self.strings[self.sequence[self.arrayPos]], curStrPos);
|
||||
}
|
||||
|
||||
// humanized value for typing
|
||||
}, humanize);
|
||||
|
||||
},
|
||||
/**
|
||||
* Shuffles the numbers in the given array.
|
||||
* @param {Array} array
|
||||
* @returns {Array}
|
||||
*/
|
||||
shuffleArray: function(array) {
|
||||
var tmp, current, top = array.length;
|
||||
if(top) while(--top) {
|
||||
current = Math.floor(Math.random() * (top + 1));
|
||||
tmp = array[current];
|
||||
array[current] = array[top];
|
||||
array[top] = tmp;
|
||||
}
|
||||
return array;
|
||||
},
|
||||
|
||||
// Start & Stop currently not working
|
||||
|
||||
// , stop: function() {
|
||||
// var self = this;
|
||||
|
||||
// self.stop = true;
|
||||
// clearInterval(self.timeout);
|
||||
// }
|
||||
|
||||
// , start: function() {
|
||||
// var self = this;
|
||||
// if(self.stop === false)
|
||||
// return;
|
||||
|
||||
// this.stop = false;
|
||||
// this.init();
|
||||
// }
|
||||
|
||||
// Reset and rebuild the element
|
||||
reset: function() {
|
||||
var self = this;
|
||||
clearInterval(self.timeout);
|
||||
var id = this.el.attr('id');
|
||||
this.el.empty();
|
||||
if (typeof this.cursor !== 'undefined') {
|
||||
this.cursor.remove();
|
||||
}
|
||||
this.strPos = 0;
|
||||
this.arrayPos = 0;
|
||||
this.curLoop = 0;
|
||||
// Send the callback
|
||||
this.options.resetCallback();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn.typed = function(option) {
|
||||
return this.each(function() {
|
||||
var $this = $(this),
|
||||
data = $this.data('typed'),
|
||||
options = typeof option == 'object' && option;
|
||||
if (data) { data.reset(); }
|
||||
$this.data('typed', (data = new Typed(this, options)));
|
||||
if (typeof option == 'string') data[option]();
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.typed.defaults = {
|
||||
strings: ["These are the default values...", "You know what you should do?", "Use your own!", "Have a great day!"],
|
||||
stringsElement: null,
|
||||
// typing speed
|
||||
typeSpeed: 0,
|
||||
// time before typing starts
|
||||
startDelay: 0,
|
||||
// backspacing speed
|
||||
backSpeed: 0,
|
||||
// shuffle the strings
|
||||
shuffle: false,
|
||||
// time before backspacing
|
||||
backDelay: 500,
|
||||
// loop
|
||||
loop: false,
|
||||
// false = infinite
|
||||
loopCount: false,
|
||||
// show cursor
|
||||
showCursor: true,
|
||||
// character for cursor
|
||||
cursorChar: "|",
|
||||
// attribute to type (null == text)
|
||||
attr: null,
|
||||
// either html or text
|
||||
contentType: 'html',
|
||||
// call when done callback function
|
||||
callback: function() {},
|
||||
// starting callback function before each string
|
||||
preStringTyped: function() {},
|
||||
//callback for every typed string
|
||||
onStringTyped: function() {},
|
||||
// callback for reset
|
||||
resetCallback: function() {}
|
||||
};
|
||||
|
||||
|
||||
}(window.jQuery);
|
||||
@@ -0,0 +1,94 @@
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
/**
|
||||
* init variables
|
||||
*/
|
||||
var large_screen = '',
|
||||
desktop = '',
|
||||
tablet = '',
|
||||
tablet_portrait = '',
|
||||
mobile_landscape = '',
|
||||
mobile = '';
|
||||
|
||||
/**
|
||||
* generate responsive @media css
|
||||
*------------------------------------------------------------*/
|
||||
jQuery(".ult-responsive").each(function(index, element) {
|
||||
|
||||
var t = jQuery(this),
|
||||
n = t.attr('data-responsive-json-new'),
|
||||
target = t.data('ultimate-target'),
|
||||
temp_large_screen = '',
|
||||
temp_desktop = '',
|
||||
temp_tablet = '',
|
||||
temp_tablet_portrait = '',
|
||||
temp_mobile_landscape = '',
|
||||
temp_mobile = '';
|
||||
|
||||
if (typeof n != "undefined" || n != null) {
|
||||
$.each($.parseJSON(n), function (i, v) {
|
||||
// set css property
|
||||
var css_prop = i;
|
||||
if (typeof v != "undefined" && v != null) {
|
||||
var vals = v.split(";");
|
||||
jQuery.each(vals, function(i, vl) {
|
||||
if (typeof vl != "undefined" || vl != null) {
|
||||
var splitval = vl.split(":");
|
||||
switch(splitval[0]) {
|
||||
case 'large_screen': temp_large_screen += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'desktop': temp_desktop += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'tablet': temp_tablet += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'tablet_portrait': temp_tablet_portrait += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'mobile_landscape':temp_mobile_landscape += css_prop+":"+splitval[1]+";"; break;
|
||||
case 'mobile': temp_mobile += css_prop+":"+splitval[1]+";"; break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* REMOVE Comments for TESTING
|
||||
*-------------------------------------------*/
|
||||
//if(temp_mobile!='') { mobile += '\n\t'+ target+ " { \t\t"+temp_mobile+" \t}"; }
|
||||
//if(temp_mobile_landscape!='') { mobile_landscape += '\n\t'+ target+ " { \t\t"+temp_mobile_landscape+" \t}"; }
|
||||
//if(temp_tablet_portrait!='') { tablet_portrait += '\n\t'+ target+ " { \t\t"+temp_tablet_portrait+" \t}"; }
|
||||
//if(temp_tablet!='') { tablet += '\n\t'+ target+ " { \t\t"+temp_tablet+" \t}"; }
|
||||
//if(temp_desktop!='') { desktop += '\n\t'+ target+ " { \t\t"+temp_desktop+" \t}"; }
|
||||
//if(temp_large_screen!='') { large_screen += '\n\t'+ target+ " { \t\t"+temp_large_screen+" \t}"; }
|
||||
|
||||
if(temp_mobile!='') { mobile += target+ '{'+temp_mobile+'}'; }
|
||||
if(temp_mobile_landscape!='') { mobile_landscape += target+ '{'+temp_mobile_landscape+'}'; }
|
||||
if(temp_tablet_portrait!='') { tablet_portrait += target+ '{'+temp_tablet_portrait+'}'; }
|
||||
if(temp_tablet!='') { tablet += target+ '{'+temp_tablet+'}'; }
|
||||
if(temp_desktop!='') { desktop += target+ '{'+temp_desktop+'}'; }
|
||||
if(temp_large_screen!='') { large_screen += target+ '{'+temp_large_screen+'}'; }
|
||||
});
|
||||
|
||||
/*
|
||||
* REMOVE Comments for TESTING
|
||||
*-------------------------------------------*/
|
||||
//var UltimateMedia = '<style>\n/** Ultimate: Media Responsive **/ ';
|
||||
// UltimateMedia += desktop;
|
||||
// UltimateMedia += "\n@media (min-width: 1824px) { "+ large_screen +"\n}";
|
||||
// UltimateMedia += "\n@media (max-width: 1199px) { "+ tablet +"\n}";
|
||||
// UltimateMedia += "\n@media (max-width: 991px) { "+ tablet_portrait +"\n}";
|
||||
// UltimateMedia += "\n@media (max-width: 767px) { "+ mobile_landscape +"\n}";
|
||||
// UltimateMedia += "\n@media (max-width: 479px) { "+ mobile +"\n}";
|
||||
// UltimateMedia += '\n/** Ultimate: Media Responsive - **/</style>';
|
||||
// jQuery('head').append(UltimateMedia);
|
||||
// //console.log(UltimateMedia);
|
||||
|
||||
var UltimateMedia = '<style>/** Ultimate: Media Responsive **/ ';
|
||||
UltimateMedia += desktop;
|
||||
/*UltimateMedia += "@media (min-width: 1824px) { "+ large_screen +"}";*/
|
||||
UltimateMedia += "@media (max-width: 1199px) { "+ tablet +"}";
|
||||
UltimateMedia += "@media (max-width: 991px) { "+ tablet_portrait +"}";
|
||||
UltimateMedia += "@media (max-width: 767px) { "+ mobile_landscape +"}";
|
||||
UltimateMedia += "@media (max-width: 479px) { "+ mobile +"}";
|
||||
UltimateMedia += '/** Ultimate: Media Responsive - **/</style>';
|
||||
jQuery('head').append(UltimateMedia);
|
||||
//console.log(UltimateMedia);
|
||||
|
||||
});
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
(function($) {␍ "use strict";␍ $(window).load(function(){␍ jQuery(".smile_icon_list").each(function(index, element) {␍ var style = jQuery(this).data('style');␍ var font = jQuery(this).data('fonts');␍ jQuery(this).find(".icon_list_icon").attr('style',style);␍ jQuery(this).find(".icon_list_item").attr('style',font);␍ });␍ });␍})(jQuery);
|
||||
@@ -0,0 +1 @@
|
||||
(function($) {␍ "use strict";␍ window.InlineShortcodeView_info_list = window.InlineShortcodeViewContainer.extend({␍ render: function() {␍ var modal_id = this.model.get('id');␍ var style = jQuery(this.$el.find('.smile_icon_list')).data('style');␍ var fonts = jQuery(this.$el.find('.smile_icon_list')).data('fonts');␍ var connector = jQuery(this.$el.find('.smile_icon_list')).data('connector');␍ window.InlineShortcodeView_info_list.__super__.render.call(this);␍ this.content().addClass('vc-element-container');␍ var info_list_iframe = jQuery("iframe").contents().find('div[data-model-id="'+modal_id+'"]');␍ info_list_iframe.find(".icon_list_item").each(function(index, element) {␍ jQuery(this).attr('style',fonts);␍ jQuery(this).find('.icon_list_icon').attr('style',style);␍ jQuery(this).find('.icon_list_connector').attr('style','border-color:'+connector);␍ });␍ this.$el.addClass('vc-container');␍ return this;␍ },␍ });␍ window.InlineShortcodeView_info_list_item = window.InlineShortcodeView.extend({␍ render: function() {␍ var style = jQuery(this.$el.find('.icon_list_icon')).parents('ul.smile_icon_list').data('style');␍ var fonts = jQuery(this.$el.find('.icon_list_icon')).parents('ul.smile_icon_list').data('fonts');␍ var connector = jQuery(this.$el.find('.icon_list_icon')).parents('ul.smile_icon_list').data('connector');␍ jQuery(this.$el.find('.icon_list_item')).each(function(index, element) {␍ jQuery(this).attr('style',fonts);␍ jQuery(this).find('.icon_list_icon').attr('style',style);␍ jQuery(this).find('.icon_list_connector').attr('style','border-color:'+connector);␍ });␍ window.InlineShortcodeView_info_list_item.__super__.render.call(this);␍ return this;␍ },␍ });␍})(jQuery);
|
||||
@@ -0,0 +1,26 @@
|
||||
(function ( jQuery ) {
|
||||
jQuery.fn.ultimate_column_shift = function(option) {
|
||||
jQuery(this).each(function(){
|
||||
var br_rad = jQuery(this).data('border-radius');
|
||||
var txt_color = jQuery(this).data('txt-color');
|
||||
var bg_col = jQuery(this).data('bg-color');
|
||||
var br_style = jQuery(this).data('br-style');
|
||||
var br_width = jQuery(this).data('br-width');
|
||||
var br_color = jQuery(this).data('br-color');
|
||||
var cl_pad = jQuery(this).data('cl-pad');
|
||||
var cl_margin = jQuery(this).data('cl-margin');
|
||||
var ani = jQuery(this).data('animation');
|
||||
var ani_delay = jQuery(this).data('animation-delay');
|
||||
console.log(ani+' '+ani_delay)
|
||||
//console.log('rad'+br_rad+'sty'+br_style+' width'+br_width+' col'+bg_col+' clpad'+cl_pad+' cl-ma'+cl_margin+' brcol'+br_color);
|
||||
jQuery(this).prev().css({'border-radius':br_rad,'background-color':bg_col,'padding':cl_pad,'margin':cl_margin,'border-style':br_style,'border-width':br_width+'px','border-color':br_color,'color':txt_color});
|
||||
jQuery(this).prev().attr('data-animation',ani);
|
||||
jQuery(this).prev().attr('data-animation-delay',ani_delay);
|
||||
jQuery(this).remove();
|
||||
})
|
||||
return this;
|
||||
}
|
||||
}( jQuery ));
|
||||
jQuery(document).ready(function(){
|
||||
jQuery('.ult-column-param').ultimate_column_shift();
|
||||
})
|
||||
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
Plugin: jQuery Parallax
|
||||
Version 1.1.3
|
||||
Author: Ian Lunn
|
||||
Twitter: @IanLunn
|
||||
Author URL: http://www.ianlunn.co.uk/
|
||||
Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
|
||||
Dual licensed under the MIT and GPL licenses:
|
||||
http://www.opensource.org/licenses/mit-license.php
|
||||
http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
(function( $ ){
|
||||
var $window = jQuery(window);
|
||||
var windowHeight = $window.height();
|
||||
$window.resize(function () {
|
||||
windowHeight = $window.height();
|
||||
});
|
||||
jQuery.fn.vparallax = function(xpos, speedFactor, outerHeight) {
|
||||
var $this = jQuery(this);
|
||||
var getHeight;
|
||||
var firstTop;
|
||||
var paddingTop = 0;
|
||||
//get the starting position of each element to have parallax applied to it
|
||||
/*$this.each(function(){
|
||||
//firstTop = $this.offset().top;
|
||||
});*/
|
||||
if (outerHeight) {
|
||||
getHeight = function(jqo) {
|
||||
return jqo.outerHeight(true);
|
||||
};
|
||||
} else {
|
||||
getHeight = function(jqo) {
|
||||
return jqo.height();
|
||||
};
|
||||
}
|
||||
// setup defaults if arguments aren't specified
|
||||
if (arguments.length < 1 || xpos === null) xpos = "50%";
|
||||
if (arguments.length < 2 || speedFactor === null) speedFactor = 0.5;
|
||||
if (arguments.length < 3 || outerHeight === null) outerHeight = true;
|
||||
//speedFactor = (jQuery(this).data('parallax_sense'))/100;
|
||||
// function to be called whenever the window is scrolled or resized
|
||||
function update(){
|
||||
var pos = $window.scrollTop();
|
||||
$this.each(function(){
|
||||
firstTop = jQuery(this).offset().top;
|
||||
var $element = jQuery(this);
|
||||
var top = $element.offset().top;
|
||||
var height = getHeight($element);
|
||||
// Check if totally above or totally below viewport
|
||||
if (top + height < pos || top > pos + windowHeight) {
|
||||
return;
|
||||
}
|
||||
var f = Math.round((firstTop - pos) * speedFactor);
|
||||
//if(firstTop >= windowHeight){
|
||||
//f = -f-(speedFactor*windowHeight);
|
||||
//}else{
|
||||
f=-f;
|
||||
//}
|
||||
if(jQuery(this).parent().hasClass('vcpb-mlvp-jquery'))
|
||||
var is_img_parallax_disable_on_mobile = jQuery(this).parent().parent().data('img-parallax-mobile-disable').toString();
|
||||
else
|
||||
var is_img_parallax_disable_on_mobile = jQuery(this).parent().data('img-parallax-mobile-disable').toString();
|
||||
if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
|
||||
var is_mobile = 'false';
|
||||
else
|
||||
var is_mobile = 'true';
|
||||
if(is_img_parallax_disable_on_mobile=='true' && is_mobile=='true')
|
||||
var disable_row_parallax_effect = 'true';
|
||||
else
|
||||
var disable_row_parallax_effect = 'false';
|
||||
|
||||
if(disable_row_parallax_effect == 'false')
|
||||
{
|
||||
//f = -f;
|
||||
jQuery(this).css('backgroundPosition', xpos + " " + f + "px");
|
||||
}
|
||||
});
|
||||
}
|
||||
$window.bind('scroll', update).resize(update);
|
||||
update();
|
||||
};
|
||||
jQuery.fn.hparallax = function(xpos, speedFactor, outerHeight) {
|
||||
var $this = jQuery(this);
|
||||
var getHeight;
|
||||
var firstTop;
|
||||
var paddingTop = 0;
|
||||
if (outerHeight) {
|
||||
getHeight = function(jqo) {
|
||||
return jqo.outerHeight(true);
|
||||
};
|
||||
} else {
|
||||
getHeight = function(jqo) {
|
||||
return jqo.height();
|
||||
};
|
||||
}
|
||||
// setup defaults if arguments aren't specified
|
||||
if (arguments.length < 1 || xpos === null) xpos = "50%";
|
||||
if (arguments.length < 2 || speedFactor === null) speedFactor = 0.5;
|
||||
if (arguments.length < 3 || outerHeight === null) outerHeight = true;
|
||||
speedFactor = (jQuery(this).data('parallax_sense'))/100;
|
||||
xpos = '0px';
|
||||
var prev_pos = $window.scrollTop();
|
||||
// function to be called whenever the window is scrolled or resized
|
||||
function update(){
|
||||
|
||||
var pos = $window.scrollTop();
|
||||
$this.each(function(){
|
||||
firstTop = jQuery(this).offset().top;
|
||||
var $element = jQuery(this);
|
||||
var top = $element.offset().top;
|
||||
var height = getHeight($element);
|
||||
if (top + height < pos || top > pos + windowHeight) {
|
||||
return;
|
||||
}
|
||||
var bg = jQuery(this).css('backgroundPosition');
|
||||
var pxpos = bg.indexOf('px');
|
||||
var bgxpos= bg.substring(0,pxpos);
|
||||
var f =0;
|
||||
if(prev_pos-pos <= 0){
|
||||
f = parseInt(bgxpos) - parseInt(speedFactor*(Math.abs(prev_pos-pos)));
|
||||
}
|
||||
else{
|
||||
f = parseInt( bgxpos ) + parseInt( speedFactor * ( prev_pos - pos ) );
|
||||
|
||||
if(f>0)
|
||||
f=0;
|
||||
}
|
||||
var is_img_parallax_disable_on_mobile = jQuery(this).parent().data('img-parallax-mobile-disable').toString();
|
||||
if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
|
||||
var is_mobile = 'false';
|
||||
else
|
||||
var is_mobile = 'true';
|
||||
if(is_mobile == 'true' && is_img_parallax_disable_on_mobile == 'true')
|
||||
var disable_row_effect = 'true';
|
||||
else
|
||||
var disable_row_effect = 'false';
|
||||
|
||||
if(disable_row_effect == 'false')
|
||||
{
|
||||
jQuery(this).css('backgroundPosition', f + "px "+ xpos);
|
||||
}
|
||||
/*if(this).hasClass('upb_bg_size_automatic'){
|
||||
jQuery(this).each(function(){
|
||||
var vh = jQuery(window).outerHeight();
|
||||
var bh = jQuery(this).parent().outerHeight();
|
||||
var speed = jQuery(this).data('parallax_sense');
|
||||
var bw = jQuery(this).outerWidth()
|
||||
var ih = (((vh+bh)/100)*speed)+bw;
|
||||
jQuery(this).css('background-size',ih+'px auto');
|
||||
})
|
||||
}*/
|
||||
});
|
||||
prev_pos = pos;
|
||||
}
|
||||
$window.bind('scroll', update).resize(update);
|
||||
update();
|
||||
};
|
||||
})(jQuery);
|
||||
// Auto Initialization
|
||||
//if( ! jQuery.browser.mobile){
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
|
||||
var is_mobile = 'false';
|
||||
else
|
||||
var is_mobile = 'true';
|
||||
|
||||
|
||||
jQuery('.vcpb-mlvp-jquery').each(function(){
|
||||
var selector = jQuery(this);
|
||||
//var sense = selector.data('parallax_sense');
|
||||
//var incr =(selector.outerWidth()*(sense/100));
|
||||
var img_list = selector.data('img-array');
|
||||
img_list = img_list.split(',');
|
||||
var img_list_len = img_list.length;
|
||||
for (var i = 0; i < img_list_len; i++) {
|
||||
jQuery(selector).prepend('<div class="vertical_layer_parallax" style="position:absolute;background-image:url('+img_list[i]+');"></div>')
|
||||
};
|
||||
var hp = jQuery(selector).find('.vertical_layer_parallax');
|
||||
hp.css({'max-width':'none','position':'absolute'});
|
||||
//hp.css('min-width',(hp.parent().outerWidth())+incr+'px');
|
||||
});
|
||||
jQuery('.vcpb-mlvp-jquery').each(function(){
|
||||
var layer_count = jQuery(this).find('.vertical_layer_parallax').length;
|
||||
var sense = parseInt(jQuery(this).data('parallax_sense'))/100;
|
||||
var is_img_parallax_disable_on_mobile = jQuery(this).parent().data('img-parallax-mobile-disable').toString();
|
||||
layer_count = (sense)/layer_count;
|
||||
sense = 0;
|
||||
|
||||
if(is_mobile == 'true' && is_img_parallax_disable_on_mobile == 'true')
|
||||
var disable_row_effect = 'true';
|
||||
else
|
||||
var disable_row_effect = 'false';
|
||||
|
||||
jQuery(this).find('.vertical_layer_parallax').each(function(index){
|
||||
sense += layer_count;
|
||||
jQuery(this).css({'height':jQuery(this).parent().outerHeight()+'px','width':jQuery(this).parent().outerWidth()+'px',}).
|
||||
attr('data-p-sense',sense);
|
||||
if(disable_row_effect == 'false')
|
||||
jQuery(this).vparallax("0%",sense);
|
||||
})
|
||||
})
|
||||
//jQuery('.vcpb-vz-jquery').vparallax();
|
||||
jQuery('.vcpb-vz-jquery').each(function(){
|
||||
var is_img_parallax_disable_on_mobile = jQuery(this).parent().data('img-parallax-mobile-disable');
|
||||
if(is_mobile == 'true' && is_img_parallax_disable_on_mobile == 'true')
|
||||
var disable_row_effect = 'true';
|
||||
else
|
||||
var disable_row_effect = 'false';
|
||||
if(disable_row_effect == 'false')
|
||||
jQuery(this).vparallax("50%",jQuery(this).data('parallax_sense')/100);
|
||||
})
|
||||
jQuery('.vcpb-hz-jquery').hparallax();
|
||||
if(jQuery('.vcpb-hz-jquery').length>0){
|
||||
setTimeout(function() {
|
||||
jQuery(window).scrollTop(0);
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
//}
|
||||
@@ -0,0 +1,47 @@
|
||||
(function(a) {
|
||||
a(document).ready(function() {
|
||||
var b = "";
|
||||
a(".ult-video-banner").each(function(g, e) {
|
||||
var k = a(e).attr("id");
|
||||
var h = a(e).data("current-time");
|
||||
var j = a(e).data("placeholder");
|
||||
var d = 0;
|
||||
a(e).find("video").get(0).addEventListener("canplay", function() {
|
||||
if (d >= 1) {
|
||||
return false
|
||||
}
|
||||
a(e).find("video").get(0).currentTime = h;
|
||||
a(e).find("video").get(0).pause();
|
||||
d++
|
||||
});
|
||||
var f = a(e).find(".ult-video-banner-overlay").data("overlay");
|
||||
var c = a(e).find(".ult-video-banner-overlay").data("overlay-hover");
|
||||
if (f != "") {
|
||||
b += "#" + k + " .ult-video-banner-overlay { background:" + f + " }"
|
||||
}
|
||||
if (c != "") {
|
||||
b += "#" + k + ".ult-vb-touch-start .ult-video-banner-overlay { background:" + c + " }"
|
||||
}
|
||||
});
|
||||
if (b != "") {
|
||||
a("head").append("<style>" + b + "</style>")
|
||||
}
|
||||
a(document).on("mouseover", ".ult-video-banner", function() {
|
||||
a(this).addClass("ult-vb-touch-start");
|
||||
a(this).find("video").get(0).play()
|
||||
});
|
||||
a(document).on("mouseout", ".ult-video-banner", function() {
|
||||
a(this).removeClass("ult-vb-touch-start");
|
||||
a(this).find("video").get(0).pause()
|
||||
});
|
||||
a(document).on("touchstart", ".ult-video-banner", function() {
|
||||
if (a(this).hasClass("ult-vb-touch-start")) {
|
||||
a(this).removeClass("ult-vb-touch-start");
|
||||
a(this).find("video").get(0).pause();
|
||||
return false
|
||||
}
|
||||
a(this).addClass("ult-vb-touch-start");
|
||||
a(this).find("video").get(0).play()
|
||||
})
|
||||
})
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,100 @@
|
||||
(function($) {
|
||||
$(document).ready(function(e) {
|
||||
var id = $('.ult-video').map( function() {
|
||||
return $(this).attr('id');
|
||||
}).get();
|
||||
var id1 = $('.ultv-video__outer-wrap').map( function() {
|
||||
return $(this).attr('data-iconbg');
|
||||
}).get();
|
||||
var id2 = $('.ultv-video__outer-wrap').map( function() {
|
||||
return $(this).attr('data-overcolor');
|
||||
}).get();
|
||||
var id3 = $('.ultv-video__outer-wrap').map( function() {
|
||||
return $(this).attr('data-defaultbg');
|
||||
}).get();
|
||||
var play = $('.ultv-video__outer-wrap').map( function() {
|
||||
return $(this).attr('data-defaultplay');
|
||||
}).get();
|
||||
var video = $('.ultv-video').map( function() {
|
||||
return $(this).attr('data-videotype');
|
||||
}).get();
|
||||
|
||||
for (var i = id.length - 1; i >= 0; i--) {
|
||||
$("#"+id[i]+ " .ultv-video").find(' .ultv-video__outer-wrap').css('color',id1[i]);
|
||||
$("#"+id[i]+ " .ultv-video").find(' .ultv-youtube-icon-bg').css({ fill: id3[i]});
|
||||
$("#"+id[i]+ " .ultv-video").find(' .ultv-vimeo-icon-bg').css({ fill: id3[i]});
|
||||
var styleElem = document.head.appendChild(document.createElement("style"));
|
||||
styleElem.innerHTML = "#"+id[i]+ " .ultv-video .ultv-video__outer-wrap:before {background: "+id2[i]+";}";
|
||||
}
|
||||
for( var j = 0; j <= play.length - 1; j++){
|
||||
if('icon' == play[j])
|
||||
{
|
||||
$(".ultv-video").find(" .ultv-video__outer-wrap").hover(function(){
|
||||
var $this =$(this);
|
||||
$this.css('color',$this.data('hoverbg'));},
|
||||
function(){
|
||||
var $this = $(this);
|
||||
$this.css('color', $this.data('iconbg'));
|
||||
});
|
||||
|
||||
}
|
||||
else if( 'defaulticon' == play[j] )
|
||||
{
|
||||
if( 'uv_iframe' == video[j] )
|
||||
{
|
||||
$(".ultv-video").find(" .ultv-video__outer-wrap").hover(function(){
|
||||
var $this = $(this);
|
||||
$this.find(' .ultv-youtube-icon-bg').css({ fill: $this.data('defaulthoverbg') });},
|
||||
function(){
|
||||
var $this = $(this);
|
||||
$this.find(' .ultv-youtube-icon-bg').css({ fill: $this.data('defaultbg') });
|
||||
});
|
||||
}
|
||||
|
||||
else if( 'vimeo_video' == video[j] )
|
||||
{
|
||||
$(".ultv-video").find(" .ultv-video__outer-wrap").hover(function(){
|
||||
var $this = $(this);
|
||||
$this.find(' .ultv-vimeo-icon-bg').css({ fill: $this.data('defaulthoverbg') });},
|
||||
function(){
|
||||
var $this = $(this);
|
||||
$this.find(' .ultv-vimeo-icon-bg').css({ fill: $this.data('defaultbg') });
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
ultvideo();
|
||||
$(window).resize(function(e){
|
||||
ultvideo();
|
||||
});
|
||||
});
|
||||
function ultvideo(){
|
||||
$('.ult-video').each(function(){
|
||||
this.nodeClass = "." +$(this).attr('id');
|
||||
var outer_wrap = jQuery(this.nodeClass).find('.ultv-video__outer-wrap');
|
||||
|
||||
outer_wrap.off( 'click' ).on( 'click', function( e ) {
|
||||
var selector = $( this ).find( '.ultv-video__play' );
|
||||
ultvideo_play( selector );
|
||||
});
|
||||
if( '1' == outer_wrap.data( 'autoplay' ) || true == outer_wrap.data( 'device' ) ) {
|
||||
ultvideo_play( jQuery(this.nodeClass).find( '.ultv-video__play' ) );
|
||||
}
|
||||
});
|
||||
}
|
||||
function ultvideo_play( selector ){
|
||||
var iframe = $( "<iframe/>" );
|
||||
var vurl = selector.data( 'src' );
|
||||
if ( 0 == selector.find( 'iframe' ).length ) {
|
||||
|
||||
iframe.attr( 'src', vurl );
|
||||
iframe.attr( 'frameborder', '0' );
|
||||
iframe.attr( 'allowfullscreen', '1' );
|
||||
iframe.attr( 'allow', 'autoplay;encrypted-media;' );
|
||||
|
||||
selector.html( iframe );
|
||||
}
|
||||
selector.closest( '.ultv-video__outer-wrap' ).find( '.ultv-vimeo-wrap' ).hide();
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
Reference in new issue
Block a user