Difference between revisions of "Template:Shanghaitech/js"

Line 2: Line 2:
  
 
function createEmptySidenav() {
 
function createEmptySidenav() {
     $('<div id="mySidenav" class="sidenav shown"><a href="javascript:void(0)" id="hide-botton" onclick="closeNav()"><span id="hide-botton-icon">&gt;</span></a></div>').appendTo('#mw-content-text');
+
     $('<div id="mySidenav" class="sidenav shown"><div id="sidenav-wrapper"><a href="javascript:void(0)" id="hide-botton" onclick="closeNav()"><span id="hide-botton-icon">&gt;</span></a></div></div>').appendTo('#mw-content-text');
 
}
 
}
  
Line 20: Line 20:
 
function createSidenavElement(title) {
 
function createSidenavElement(title) {
 
     elementHTML = '<a href="#%id">%title</a>'.replace("%title", title.textContent).replace("%id", title.id);
 
     elementHTML = '<a href="#%id">%title</a>'.replace("%title", title.textContent).replace("%id", title.id);
     $(elementHTML).appendTo("#mySidenav");
+
     $(elementHTML).appendTo("#sidenav-wrapper");
 
}
 
}
  

Revision as of 14:41, 29 October 2017