Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Adding the progress event information
  • Loading branch information
rveciana committed May 31, 2016
commit 42342720e16527202b17ffdde8b4196e68a4f83a
7 changes: 7 additions & 0 deletions graph-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ function graphScroll() {
isFixed = isFixed1
graph.classed('graph-scroll-fixed', isFixed)
}

var pos = pageYOffset - 10 - containerStart;
var prevTop = sectionPos[i];
var nextTop = (i+1<sectionPos.length?sectionPos[i+1]:(belowStart-containerStart)) - 200 ;
var progress = (pos - prevTop) / (nextTop - prevTop);
if(progress>=0 && progress <=1)
dispatch.scroll(i, progress);
}

function resize(){
Expand Down