Skip to content

Commit 1a9612b

Browse files
committed
首页增加回到顶部
1 parent b3337f1 commit 1a9612b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

static/css/main.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,4 +980,20 @@ a{color: #333}
980980
.ucenter-content li .col-xs-3{padding-right: 0}
981981
}
982982

983-
.cate-intro{border: 1px dashed #ccc;margin: 0 0 15px 0;padding: 5px 10px;box-sizing: border-box;color: #787878}
983+
.cate-intro{border: 1px dashed #ccc;margin: 0 0 15px 0;padding: 5px 10px;box-sizing: border-box;color: #787878}
984+
985+
.backtop{
986+
position: fixed;
987+
bottom: 50px;
988+
right: 50px;
989+
z-index: 9999;
990+
width: 45px;
991+
height: 45px;
992+
text-align: center;
993+
border: 1px solid #ddd;
994+
font-size: 20px;
995+
line-height: 40px;
996+
border-radius: 4px;
997+
cursor: pointer;
998+
}
999+
.backtop:hover{background-color: #dddddd;color: #10af88;}

views/cates/list.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ <h3 class="panel-title">
9898

9999
</div>
100100
</div>
101+
<div class="backtop tooltips" title="回到顶部">
102+
<i class="fa fa-arrow-up"></i>
103+
</div>
101104
{{template "widgets/footer.html" .}}
102105
<script>
103106
'use strict';
@@ -144,6 +147,10 @@ <h3 class="panel-title">
144147
$(window).scroll(function () {
145148
fixed()
146149
})
150+
151+
$(".backtop").click(function () {
152+
$(window).scrollTop(0)
153+
});
147154
})
148155
</script>
149156
</body>

0 commit comments

Comments
 (0)