HANSONGTSENG (Talk | contribs) |
HANSONGTSENG (Talk | contribs) |
||
Line 493: | Line 493: | ||
var items = document.getElementsByClassName("sidebar-item"); | var items = document.getElementsByClassName("sidebar-item"); | ||
$(window).scroll(function(){ | $(window).scroll(function(){ | ||
− | + | console.log("one"); | |
+ | 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); | ||
} | } | ||
− | |||
for (var i = 0; i < subtitles.length; i++) { | for (var i = 0; i < subtitles.length; i++) { | ||
if (window.pageYOffset >=borders[i]){ | if (window.pageYOffset >=borders[i]){ |
Revision as of 05:04, 12 July 2018