Skip to content
Snippets Groups Projects
Commit 8271e1f0 authored by sky's avatar sky
Browse files

唔 上传2

parent 2d5b2038
No related branches found
No related tags found
No related merge requests found
Pipeline #162522 passed
<div class="goTop">
<span>back To top</span>
</div>
<footer>
......@@ -74,15 +80,66 @@
</footer>
<div style="font-size: 1.5rem; color: rgb(0, 0, 0);width: 100vw;padding: 30px 20vw;background-color: #fff;">
<div style="font-size: 1.5rem; color: rgb(0, 0, 0);width: 100vw;padding: 30px 20vw;background-color: #fff;margin: 0 auto;">
<div>
<p><small>© 2022 - Content on this site is licensed under a <a style="color: #108b96;" href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International license</a>.</small></p>
<p><small>The repository used to create this website is available at <a style="color: #108b96;" href="https://gitlab.igem.org/2022/sesame-shenzhen">gitlab.igem.org/2022/sesame-shenzhen</a>.</small></p>
</div>
</div>
<script>
function goTop(min_height) {
$(".goTop").click(
function() {
$('html,body').animate({
scrollTop: 0
}, 700);
});
//获取页面的最小高度,无传入值则默认为600像素
min_height=min_height?min_height:400;
//为窗口的scroll事件绑定处理函数
$(window).scroll(function() {
//获取窗口的滚动条的垂直位置
var s = $(window).scrollTop();
//当窗口的滚动条的垂直位置大于页面的最小高度时,让返回顶部元素渐现,否则渐隐
if (s > min_height) {
$(".goTop").fadeIn(100);
} else {
$(".goTop").fadeOut(200);
}
});
}
$(function() {
goTop();
});
$("a[href*=\\#],area[href*=\\#]").click(function() { //若报错则改为$(document).on('click', 'a[href^="#"]', function () {
console.log(111)
......
......@@ -14,6 +14,42 @@
margin-top: 27vh;
margin-left: 35vw;
}
.goTop {
height: 44px;
width: 128px;
background: #509296;
border-radius: 22px;
position: fixed;
top: 90%;
right: 3%;
display: none;
}
.goTop span {
color: #fff;
position: absolute;
top: 12px;
left: 8px;
width:88%;
margin: 0 auto;
text-align:center;
}
</style>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment