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 inView(el){ | |
//check if a DOM element is in view | |
var scrollDistance=document.body.scrollTop; | |
if (scrollDistance>=el.offsetTop&&scrollDistance<el.offsetHeight+el.offsetTop) { | |
return true; | |
}else{ | |
return 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
$.fn.transitionEnd = function(callback) { | |
//plugin for detecting the end of a transition and then doing a callback | |
$(this).one('webkitTransitionEnd otransitionend msTransitionEnd transitionend', | |
function(e) { | |
if (typeof callback == 'function') { | |
callback.call(this); | |
} | |
}); | |
}; |
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() { | |
function isPlaceholderSupported() { | |
var input = document.createElement("input"); | |
return ('placeholder' in input); | |
} | |
var placeholdersupport = isPlaceholderSupported(); | |
if (placeholdersupport == false) { | |
// If there is no placeholder support, |
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
$formField.click(function(){ | |
var $_this= $(this); | |
$_this | |
.css('opacity','1') | |
.find('input').removeAttr('disabled'); | |
$_this.siblings() | |
.css('opacity','.5') | |
.find('input').attr('disabled','disabled'); | |
}); |
NewerOlder