【发布时间】:2020-10-13 23:20:55
【问题描述】:
我想在页面加载时隐藏滚动条
这是我的 javascript
<script type='text/javascript'>
//paste this code under the head tag or in a separate js file.
// Wait for window load
$(window).load(function() {
// Animate loader off screen
$(".se-pre-con").fadeOut("slow");;
});
</script>
(编辑:) 我忘记包含 css ......对不起
<!-- CSS Loading Start -->
.no-js #loader { display: none; background-color:#0c0c0c; }
.js #loader { display: block; position: absolute; left: 100px; top: 0; background-color:rgb(12,12,12); }
.se-pre-con {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url(https://cdn.discordapp.com/attachments/724396372891009086/724725986326741032/Loading_Bar_Animation.gif) center no-repeat #000000;
}
<!-- CSS Loading End -->
【问题讨论】:
-
只是让你的页面更小,这样就不需要滚动了吗?
-
可能是 JavaScript 错误:$(".se-pre-con").fadeOut("slow");
标签: javascript html loading