Fixed first section in scroll link extension

This commit is contained in:
benweet 2013-11-19 23:46:16 +00:00
parent 4e2ad5766b
commit 16169d5382

View File

@ -106,7 +106,7 @@ define([
// Something wrong in the algorithm... // Something wrong in the algorithm...
return; return;
} }
var posInSection = (srcScrollTop - srcSection.startOffset) / srcSection.height; var posInSection = (srcScrollTop - srcSection.startOffset) / (srcSection.height || 1);
var destSection = destSectionList[sectionIndex]; var destSection = destSectionList[sectionIndex];
return destSection.startOffset + destSection.height * posInSection; return destSection.startOffset + destSection.height * posInSection;
} }