From 4ac863b5576646d0e71cb731e1a946838a744391 Mon Sep 17 00:00:00 2001 From: William Neely Date: Tue, 10 Jun 2014 16:20:08 -0400 Subject: [PATCH] fix for when using responsive boxes If using the padding bottom technique to create square tiles, the plugin doesn't work because parent().height will return the height without the padding. --- jquery.tiltedpage-scroll.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.tiltedpage-scroll.js b/jquery.tiltedpage-scroll.js index 25f4929..1682c35 100644 --- a/jquery.tiltedpage-scroll.js +++ b/jquery.tiltedpage-scroll.js @@ -65,8 +65,8 @@ var el2 = $(this), opacity = 0, st = $(window).scrollTop(), - deg = ((el2.parent().offset().top - el2.parent().height()) - st) / $(window).height() * (settings.angle * 3), - scale = ((st + $(window).height() - (el2.parent().offset().top - el2.parent().height())) / ($(window).height() )) ; + deg = ((el2.parent().offset().top - el2.parent().outerHeight(true)) - st) / $(window).height() * (settings.angle * 3), + scale = ((st + $(window).height() - (el2.parent().offset().top - el2.parent().outerHeight(true))) / ($(window).height() )) ; if(scale > 1) scale = 1; if(deg < 0) deg = 0;