|
|
@ -31,10 +31,13 @@ App.init = -> |
|
|
App.scroll = -> |
|
|
App.scroll = -> |
|
|
v_scroll = $(document).scrollTop() |
|
|
v_scroll = $(document).scrollTop() |
|
|
section = Math.floor(v_scroll / $(window).innerHeight()) |
|
|
section = Math.floor(v_scroll / $(window).innerHeight()) |
|
|
bg_pos = (v_scroll-(section*$(window).innerHeight()))/2 |
|
|
|
|
|
$($(".section")[section]).css( |
|
|
|
|
|
|
|
|
[section, section+1].forEach (section) -> |
|
|
|
|
|
bg_pos = -((v_scroll-(section*$(window).innerHeight()))/2) |
|
|
|
|
|
section_element = $($(".section")[section]) |
|
|
|
|
|
if section_element and section_element.css("background-image") != "none" |
|
|
|
|
|
section_element.css( |
|
|
"background-position", |
|
|
"background-position", |
|
|
"center -" + bg_pos + "px") |
|
|
|
|
|
|
|
|
"center " + bg_pos + "px") |
|
|
|
|
|
|
|
|
$(document).on "page:change", -> |
|
|
$(document).on "page:change", -> |
|
|
App.init() |
|
|
App.init() |
|
|
|