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 windowW = $(window).width(), | |
windowH = $(window).height(); | |
var resizeThread = 0; | |
function responsiveReturn() { | |
clearTimeout(resizeThread); | |
windowW = $(window).width(); | |
windowH = $(window).height(); |
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 isChrome = navigator.userAgent.indexOf('Chrome') > -1; | |
var isFireFox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; | |
var isSafari = navigator.userAgent.indexOf('Safari') > -1; | |
if ((isChrome)&&(isSafari)) {isSafari=false;} | |
var isIE = navigator.appName.indexOf('Internet Explorer')!=-1; | |
var isIE7 = navigator.appVersion.indexOf("MSIE 7.") != -1; | |
var isIE8 = navigator.appVersion.indexOf("MSIE 8.") != -1; | |
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? isTabletMobile = true : isTabletMobile = false; | |
/iPad/i.test(navigator.userAgent) ? isTablet = true : isTablet = false; | |
/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? isMobile = true : isMobile = 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
var currentUrl = top.location.href; | |
var currentHash = window.location.hash; | |
if ( currentHash.length > 0 ) { | |
var stripHash = currentHash.replace('#!/',''); | |
} |
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
// source: http://stackoverflow.com/a/4770179/1428241 | |
var keys = [37, 38, 39, 40]; | |
function preventDefault(e) { | |
e = e || window.event; | |
if (e.preventDefault) | |
e.preventDefault(); | |
e.returnValue = false; | |
} | |
function keydown(e) { |
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() { | |
functionsss.init(); | |
}); | |
functionsss = { | |
init: 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 detectBackOrForward = function(onBack, onForward) { | |
hashHistory = [window.location.hash]; | |
historyLength = window.history.length; | |
return function() { | |
var hash = window.location.hash, length = window.history.length; | |
if (hashHistory.length && historyLength == length) { | |
if (hashHistory[hashHistory.length - 2] == hash) { | |
hashHistory = hashHistory.slice(0, -1); | |
onBack(); |
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 currentScroll = 0; | |
$(window).scroll(function() { | |
var nextScroll = $(this).scrollTop(); | |
if ( nextScroll > currentScroll ) {// scroll down | |
}else{// scroll up | |
} |
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
// Sample: http://stackoverflow.com/questions/12608356/how-to-build-simple-jquery-image-slider-with-sliding-or-opacity-effect/12608357#12608357 | |
var $selector = $(selector); | |
var $btnPrev = $selector.find('.tri-prev'); | |
var $btnNext = $selector.find('.tri-next'); | |
var $slides = $selector.find('.slides li'); | |
var lastIndex = $slides.length-1; | |
var index; |
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
$('*[placeholder]').val(function () { return $(this).prop('placeholder')}); | |
$(document).on('focus', '[placeholder]',function(){ | |
$(this).val() == $(this).prop('placeholder') ? $(this).val('') : ''; | |
}); | |
$(document).on('blur', '[placeholder]',function(){ | |
$(this).val() == '' ? $(this).val($(this).prop('placeholder')) : ''; | |
}); |
OlderNewer