Permalink
Browse files

feat: button value 按钮文字切换

Switch button value when clicked.
  • Loading branch information...
MOxFIVE committed Sep 14, 2015
1 parent 2828424 commit b63d062984badfff94acdb64a1cff506462cf79c
Showing with 3 additions and 1 deletion.
  1. +3 −1 themes/Yilia/layout/_partial/article.ejs
@@ -33,7 +33,7 @@
<%- toc(post.content) %>
</div>
<input type="button" id="tocButton" value="目录开关" title="点击按钮隐藏或者显示文章目录">
<input type="button" id="tocButton" value="隐藏目录" title="点击按钮隐藏或者显示文章目录">
<script type="text/javascript">
var toc_button= document.getElementById("tocButton");
var toc_div= document.getElementById("toc");
@@ -42,9 +42,11 @@
toc_button.onclick=function(){
if(toc_div.style.display=="none"){
toc_div.style.display="block";
toc_button.value="隐藏目录";
}
else{
toc_div.style.display="none";
toc_button.value="显示目录";
}
}
</script>

0 comments on commit b63d062

Please sign in to comment.