HANSONGTSENG (Talk | contribs) |
HANSONGTSENG (Talk | contribs) |
||
Line 492: | Line 492: | ||
var subtitles = document.getElementsByClassName("section"); | var subtitles = document.getElementsByClassName("section"); | ||
var items = document.getElementsByClassName("sidebar-item"); | var items = document.getElementsByClassName("sidebar-item"); | ||
− | |||
− | |||
var borders = [0]; | var borders = [0]; | ||
for (var i = 0; i <= subtitles.length - 1; i++) { | for (var i = 0; i <= subtitles.length - 1; i++) { | ||
borders.push(subtitles[i].scrollHeight+borders[i]-100); | borders.push(subtitles[i].scrollHeight+borders[i]-100); | ||
} | } | ||
+ | |||
+ | $(window).scroll(function(){ | ||
console.log(borders); | console.log(borders); | ||
console.log(sidebar); | console.log(sidebar); |
Revision as of 07:53, 12 July 2018