Difference between revisions of "Template:NYMU-Taipei/newtemplate1"

Line 497: Line 497:
 
     }
 
     }
 
borders.shift();
 
borders.shift();
 +
borders.push(borders[-1]+100000);
 
     $(window).scroll(function(){
 
     $(window).scroll(function(){
 
console.log(borders);  
 
console.log(borders);  
Line 502: Line 503:
 
         for (var i = 0; i <= subtitles.length; i++) {
 
         for (var i = 0; i <= subtitles.length; i++) {
 
         if (window.pageYOffset >=borders[i]-500){
 
         if (window.pageYOffset >=borders[i]-500){
         if((window.pageYOffset <=borders[i+1]-500) ||( i == subtitles.length)) {
+
         if(window.pageYOffset <=borders[i+1]-500) {
 
         sidebar[i].style.display = "inline-block";
 
         sidebar[i].style.display = "inline-block";
 
console.log('fuck');
 
console.log('fuck');

Revision as of 13:55, 12 July 2018