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);})

更多相关文章

  1. jQuery Ui Draggable在移动端浏览器不起作用解决方案
  2. html2canvas 识别 svg 解决方案
  3. HTML5用户身份认证源代码:注册、登录、会话保持的解决方案
  4. 用于在表中强制换行的PHP或HTML/CSS解决方案
  5. 如何实现分布式文件上传解决方案?
  6. 一套PHP做app接口的解决方案
  7. curl获取网页内容出现乱码或为空的解决方案,另附curl_getinfo函数
  8. PHP XAMPP配置PHP环境和Apache80端口被占用解决方案
  9. mysql主从同步报slave_sql_running:no的解决方案

随机推荐

  1. Android源码博文集锦2
  2. Android中进程管理
  3. Android 入门开发指南之一 -- Hello,Andr
  4. Android 面试经验 - Android 进程间的通
  5. Android第一行代码笔记
  6. 线性布局控件间的布局设置
  7. Android的源代码结构
  8. Android弹性listview滚动
  9. Android常用布局之LinearLayout(线性布局
  10. Android窗口治理机制