diff --git a/app/assets/javascripts/parallax.coffee b/app/assets/javascripts/parallax.coffee index b75e9d4..05a10b7 100644 --- a/app/assets/javascripts/parallax.coffee +++ b/app/assets/javascripts/parallax.coffee @@ -8,7 +8,11 @@ content_top = content_left = width_delta = height_delta = 0 App.init = -> $('a[href*=\\#]').each -> - if location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') and location.hostname == this.hostname and this.hash.replace(/#/,'') + lpath = location.pathname.replace(/^\//,'') + tpath = this.pathname.replace(/^\//,'') + if lpath == tpath and + location.hostname == this.hostname and + this.hash.replace(/#/,'') $targetId = $(this.hash) $targetAnchor = $('[name=' + this.hash.slice(1) + ']') $target = if $targetId.length