Initialised object

This commit is contained in:
Jake Howard 2015-08-13 13:43:42 +01:00
parent 0a3cf31b37
commit 74b41d494d

View file

@ -1,3 +1,23 @@
var Parallax = {
initialise: function() {
},
calculate: function() {
},
events: function() {
},
}
function is_on_screen(elm) {
var vpH = $(window).height(), // Viewport Height
st = $(window).scrollTop(), // Scroll Top
y = $(elm).offset().top,
elementHeight = $(elm).height();
return ((y < (vpH + st)) && (y > (st - elementHeight)));
}
function init_parallax() {
$('.parallax').each(function(){
// Calculate Offset