登陆页面有延迟然后自动向下滚动
16lz
2021-01-22
I'm new to jquery/javascript and have came across an issue.
我是jquery / javascript的新手,遇到了一个问题。
I have a landing page that displays a large logo. I am wanting a 3 second pause/delay before the automated scroll takes effect.
我有一个显示大徽标的登录页面。我希望在自动滚动生效之前有3秒的暂停/延迟。
the code I am using at the moment is-
我目前使用的代码是 -
JS
$('html, body').animate({scrollTop: $('#hello').offset().top}, 4000);
HTML
<div class="fillwindow" style="background-image:url('#')">
<div class="landing__logo">
<img class="landing__logo-img" src="#">
</div>
</div>
<div class="fillwindow" id="hello" style="background-image:url('#')">
<div class="nav-header">
<a href="<?php home_url(); ?>portfolio" class="nav-btn js-navBtn">PORTFOLIO</a>
</div>
<a href="<?php home_url(); ?>portfolio"><div class="nav-hitstate"></div></a>
</div>
2 个解决方案
#1
As per the comments above:
根据上述评论:
$(document).ready(function() {
setTimeout(function() {
('html, body').animate({scrollTop: $('#hello').offset().top },4000);
}, 2000);})
更多相关文章
- jQuery Ui Draggable在移动端浏览器不起作用解决方案
- html2canvas 识别 svg 解决方案
- HTML5用户身份认证源代码:注册、登录、会话保持的解决方案
- 用于在表中强制换行的PHP或HTML/CSS解决方案
- 如何实现分布式文件上传解决方案?
- 一套PHP做app接口的解决方案
- curl获取网页内容出现乱码或为空的解决方案,另附curl_getinfo函数
- PHP XAMPP配置PHP环境和Apache80端口被占用解决方案
- mysql主从同步报slave_sql_running:no的解决方案