javascript - 页面完全加载后滑动页面

标签 javascript jquery css html

我只想在完全加载后才滑动我的页面。 我用

 href="page#a"

 href="page#b"

但是,a 和 b 部分的初始位置不是最终位置。我的页面从 SP 加载图表和数据,这需要几秒钟,使 div a 和 b 转到页面的下部。谢谢。

最佳答案

.load()中写下你的代码

$( window ).load(function() {

 //whatever you write here will get executed when the page is fully loaded 

  $.ajax({
    dataType: 'json',
    beforeSend : function() {
       console.log('Before Ajax Request Starts !!');
    },
    success: function(data) {
        /*__YOUR CODE GOES HERE  
        AFTER PAGE LOADS AND AJAX COMPLETES LOADING_
         _____code for sliding ______
        */
    }
  });  



});

关于javascript - 页面完全加载后滑动页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35030377/

相关文章:

css - 如何删除未使用的 CSS 规则

html - 如何在页面顶部创建一个倾斜的 div 标题

javascript - event.waitUntil 在 Service Worker 中做什么以及为什么需要它?

javascript - 用 jQuery Knob Dial 包围输入元素

c# - 将 C# 字符串数组转换为 Javascript 数组

javascript - 使用 jQuery 播放声音时摆脱延迟时间

javascript - PHP:如何在 php 中使用 GET 将值存储到数组

java - 如何在 Spring MVC Controller 中接受二维数组?

javascript - AJAX 和相对路径范围

css - 如何在不将其上传到元素的情况下使用 FontAwesome 字体图标?