移动到命名锚后的jQuery / JavaScript的处理 [英] Moving to named anchor after jquery/javascript processing

查看:82
本文介绍了移动到命名锚后的jQuery / JavaScript的处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在做一些jQuery处理后如何将焦点移动到不同的部分(锚点)在同一页上。

How do move focus to a different section (named anchor) on the same page after doing some jquery processing.

功能ABC()做了一些处理,之后,我需要将用户移动到部分相同的页面(进一步下跌的页面)。

Function ABC() does some processing and afterwards, I need to move the user to a section on the same page (further down the page).

推荐答案

您可以用code以下滚动屏幕到< D​​IV ID =导航> 。只要改变选择您要滚动到的元素相匹配。

You can use the code below to scroll the screen to a <div id="navigation">. Just change the selector to match the element you want to scroll to.

$('html, body').animate({ scrollTop: $('#navigation').offset().top }, 'slow');

这篇关于移动到命名锚后的jQuery / JavaScript的处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆