This file contains hidden or 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
// Disable link clicks to prevent page scrolling | |
$('a[href="#fakelink"]').on('click', function (e) { | |
e.preventDefault(); | |
}); |
This file contains hidden or 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 contentOffset() { | |
var droppx = /\d+/; | |
var navheight = $('header > .navbar').css('height'); | |
var subnavheight = $('header > .navbar + .sub-nav').css('height'); | |
var breadcrumbheight = $('.breadcrumb').css('height'); | |
var offset = 0; | |
if ($('.page-header').length > 0) { | |
var pageheaderheight = $('.page-header').css('height'); | |
offset = parseInt(navheight.match(droppx)) + parseInt(subnavheight.match(droppx)) + parseInt(breadcrumbheight.match(droppx)) + parseInt(pageheaderheight.match(droppx)) + 1; | |
} else { |
This file contains hidden or 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
// Detect IE and iOS and add browser class to document | |
var tag = document.getElementsByTagName('html')[0]; | |
var ua = navigator.userAgent; | |
var version = ''; | |
if (/msie (\d+)/i.test(ua)) { | |
version = 'IE IE-' + /msie (\d+)/i.exec(ua)[1]; | |
if (tag.className.length > 0) { | |
tag.className = tag.className + ' ' + version; | |
} else { | |
tag.className = version; |
This file contains hidden or 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 validatePhoneNumber(phonenumber) { | |
var pattern = /^(?:(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:\s+|#|x\.?|ext\.?|extension)\s*(\d+))?$/i; | |
var matches = []; | |
var validnumber = []; | |
validnumber.unformatted = ''; | |
if (phonenumber.length > 0) { | |
if (pattern.test(phonenumber)) { | |
matches = phonenumber.match(pattern); | |
// split phone number input into phone number format array |
NewerOlder