This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.digits = function(){ | |
return this.each(function(){ | |
$(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") ); | |
}) | |
} | |
$('#animateItem').each(function () { | |
$(this).prop('Counter',0).animate({ | |
Counter: $(this).text() | |
}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// validation | |
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
var emailIsValid = false; | |
if(emailRegex.test(myEmail.val())){ | |
emailIsValid = true; | |
} else { | |
emailIsValid = false; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".ui-number input").keydown(function (e) { | |
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || | |
(e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) || | |
(e.keyCode >= 35 && e.keyCode <= 40)) { | |
return; | |
} | |
if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { | |
e.preventDefault(); | |
} | |
if ( $(this).val().length > 5 ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).mouseup(function (e) { | |
var container = new Array(); | |
container.push($('.mobile-navi')); | |
$.each(container, function(key, value) { | |
if (!$(value).is(e.target) && $(value).has(e.target).length === 0) { | |
$(value).removeClass('is-active'); | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calcLocation(){ | |
function containsAll(needles, haystack){ | |
for(var i = 0 , len = needles.length; i < len; i++){ | |
if($.inArray(needles[i], haystack) == -1) return false; | |
} | |
return true; | |
} | |
function titleCase(str) { | |
return str.split(' ').map(function(val){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set dalay on scroll event to prevent huge memory leaks | |
(function($) { | |
var uniqueCntr = 0; | |
$.fn.scrolled = function (waitTime, fn) { | |
if (typeof waitTime === "function") { | |
fn = waitTime; | |
waitTime = 50; | |
} | |
var tag = "scrollTimer" + uniqueCntr++; | |
this.scroll(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _mastersSlickMobile = $('.masters__wrapper'); | |
var mastersSlickMobileOptions = { | |
mobileFirst: true, | |
responsive: [ | |
{ | |
breakpoint: 768, | |
settings: "unslick" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hero parallax on mousemove | |
var movementStrength = 50; | |
var height = movementStrength / _window.height(); | |
var width = movementStrength / _window.width(); | |
$(".hero").mousemove(function(e){ | |
var pageX = e.pageX - (_window.width() / 2); | |
var pageY = e.pageY - (_window.height() / 2); | |
var newvalueX = width * pageX * -1 - 25; | |
var newvalueY = height * pageY * -1 - 50; | |
$('.hero-bg').css("background-position", newvalueX+"px "+newvalueY+"px"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_window.scrolled(10, function () { | |
var stickyEl = $('.results__map'); | |
var windowBottomScroll = _window.scrollTop() + _window.height(); | |
var stopPoint = _document.height() - $('footer').outerHeight(); | |
if (windowBottomScroll >= stopPoint) { | |
stickyEl.addClass('results__map--stop'); | |
} else if (windowBottomScroll < stopPoint) { | |
stickyEl.removeClass('results__map--stop'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TELEPORT PLUGIN | |
$('[js-teleport]').each(function (i, val) { | |
var self = $(val) | |
var objHtml = $(val).html(); | |
var target = $('[data-teleport-target=' + $(val).data('teleport-to') + ']'); | |
var conditionMedia = $(val).data('teleport-condition').substring(1); | |
var conditionPosition = $(val).data('teleport-condition').substring(0, 1); | |
if (target && objHtml && conditionPosition) { | |
_window.resized(100, function () { |
OlderNewer