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
$('iframe').contents().mousemove( function(e) { | |
console.log( e.clientX, e.clientY ); | |
}); |
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.fullHeight = function( offset ){ | |
// Check if offset specified | |
if (offset === '') { | |
// If it's not then set it to 0 | |
offset = 0; | |
} | |
// Maintain chainability |
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($) { | |
$.fn.descendantOf = function(parentId) { | |
return this.closest(parentId).length != 0; | |
} | |
})(jQuery) | |
/* | |
* USAGE | |
* $('#element').descendantOf('#another-element'); if #element is within #another-element then this will return true | |
* |