menu fix
This commit is contained in:
@@ -115,7 +115,7 @@ function make_menu() {
|
||||
var sel=document.createElement("select");
|
||||
sel.onchange=function(){
|
||||
if (this.value=="") { return }
|
||||
document.getElementById("anchor_"+this.value).scrollIntoView();
|
||||
document.getElementById(this.value).scrollIntoView();
|
||||
document.getElementById("menu").value="";
|
||||
};
|
||||
sel.id="menu";
|
||||
@@ -124,13 +124,15 @@ function make_menu() {
|
||||
opt.value="";
|
||||
opt.innerHTML="#";
|
||||
sel.appendChild(opt);
|
||||
var anchor_index = 0;
|
||||
for (c=0; c<linkList.length; c++) {
|
||||
if ( linkList[c].substring(0,2) == "# " ) {
|
||||
var opt=document.createElement("option");
|
||||
var name=linkList[c].substring(1).trim().replace(/ /g,"");
|
||||
opt.innerHTML=linkList[c].trim();
|
||||
opt.value=name.replace(/^#/,"");
|
||||
opt.value="anchor_" + name.replace(/^#/,"") + "_" + anchor_index;
|
||||
sel.appendChild(opt);
|
||||
anchor_index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user