(새 문서: //목차리스트를 고정해서 볼 수 있는 버튼을 만들어 줍니다.) |
편집 요약 없음 |
||
1번째 줄: | 1번째 줄: | ||
//목차리스트를 고정해서 볼 수 있는 버튼을 만들어 줍니다. | //목차리스트를 고정해서 볼 수 있는 버튼을 만들어 줍니다. | ||
if(mw.config.get("skin")=="liberty"){ | |||
var a = "<button type=\"button\" class=\"btn btn-default\" aria-label=\"Left Align\"> <span class=\"fa fa-list\" aria-hidden=\"true\"></span></button>"; | |||
var indexButton = document.createElement("button"); | |||
indexButton.type = "button"; | |||
indexButton.className = "btn btn-default"; | |||
indexButton.innerHTML = "<span class=\"fa fa-list\" aria-hidden=\"true\"></span>"; | |||
indexButton.style.position = "fixed"; | |||
indexButton.style.top = "48px"; | |||
indexButton.style.left = "0px"; | |||
window.damezuma = {doc:null}; | |||
$(indexButton).click(function(){ | |||
if(window.damezuma.doc == null){ | |||
window.damezuma.doc = $("#toc").clone(); | |||
$(document.body).append(window.damezuma.doc); | |||
$(window.damezuma.doc).css({ | |||
"position":"fixed", | |||
"top":$(indexButton).height() + 72, | |||
"left":0, | |||
"background-color":"#333", | |||
"color":"#FFF", | |||
"padding":"16px", | |||
"bottom":0 | |||
}); | |||
} | |||
else{ | |||
$(window.damezuma.doc).remove(); | |||
window.damezuma.doc = null; | |||
} | |||
}); | |||
$(document.body).append(indexButton); | |||
} |
2015년 12월 24일 (목) 16:17 판
//목차리스트를 고정해서 볼 수 있는 버튼을 만들어 줍니다.
if(mw.config.get("skin")=="liberty"){
var a = "<button type=\"button\" class=\"btn btn-default\" aria-label=\"Left Align\"> <span class=\"fa fa-list\" aria-hidden=\"true\"></span></button>";
var indexButton = document.createElement("button");
indexButton.type = "button";
indexButton.className = "btn btn-default";
indexButton.innerHTML = "<span class=\"fa fa-list\" aria-hidden=\"true\"></span>";
indexButton.style.position = "fixed";
indexButton.style.top = "48px";
indexButton.style.left = "0px";
window.damezuma = {doc:null};
$(indexButton).click(function(){
if(window.damezuma.doc == null){
window.damezuma.doc = $("#toc").clone();
$(document.body).append(window.damezuma.doc);
$(window.damezuma.doc).css({
"position":"fixed",
"top":$(indexButton).height() + 72,
"left":0,
"background-color":"#333",
"color":"#FFF",
"padding":"16px",
"bottom":0
});
}
else{
$(window.damezuma.doc).remove();
window.damezuma.doc = null;
}
});
$(document.body).append(indexButton);
}