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

Line 494: Line 494:
 
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]);
 
     }
 
     }
 
borders.shift();
 
borders.shift();
Line 503: Line 503:
 
         if (window.pageYOffset >=borders[i]){
 
         if (window.pageYOffset >=borders[i]){
 
         if(window.pageYOffset <=borders[i+1]) {
 
         if(window.pageYOffset <=borders[i+1]) {
         sidebar[i].style.display = "inline-block";
+
         sidebar[i].style.display = "block";
 
         }
 
         }
 
         else{
 
         else{
Line 516: Line 516:
  
 
     $(".sidebar-item").mouseenter(function(){
 
     $(".sidebar-item").mouseenter(function(){
         this.lastChild.style.display = "inline-block";
+
         this.lastChild.style.display = "block";
 
});
 
});
 
$(".sidebar-item").mouseleave(function(){
 
$(".sidebar-item").mouseleave(function(){

Revision as of 07:58, 12 July 2018