Permalink
Browse files

feat: add toBottom button 添加返回底部按钮

Put a toBottom button on the right for quick scrolling. <a
href="#footer”>
在页面右边加了个返回底部按钮便于页面跳转。

http://jingyan.baidu.com/article/8275fc86b79e6446a13cf66b.html
  • Loading branch information...
MOxFIVE committed Aug 26, 2015
1 parent 977d4dd commit e147e307d32f0080afaec3ca94f57895abe94a3f
Showing with 31 additions and 2 deletions.
  1. +10 −0 themes/Yilia/layout/_partial/article.ejs
  2. +21 −2 themes/Yilia/source/css/_partial/article.styl
@@ -59,6 +59,16 @@
}
</script>
<div id="toBottom">
<a href="#footer" style="color:white"></a>
</div>
<!-- to bottom via JavaScript -->
<!--<div id="toBottom">
<a href="javascript:void(0);" onclick="javascript:document.getElementsByTagName('BODY')[0].scrollTop=document.getElementsByTagName('BODY')[0].scrollHeight;"></a>
</div> -->
<%- post.content %>
<% } %>
</div>
@@ -399,7 +399,7 @@
padding-left: 1.25em
}
#toTop{
#toTop {
display:block;
padding:0.05em;
border-radius:0.15em;
@@ -413,7 +413,26 @@
position: fixed;
cursor: pointer;
color: #fff;
top: 40%;
top: 41%;
right: 1px;
opacity:0.6;
}
#toBottom {
display:block;
padding:0.05em;
border-radius:0.15em;
width:1.1em;
height:1.4em;
line-height:1.3em;
font-size:1.5em;
font-family: Calibri;
text-align: center;
background:lightgray;
position: fixed;
cursor: pointer;
color: #fff;
top: 47%;
right: 1px;
opacity:0.6;
}

0 comments on commit e147e30

Please sign in to comment.