Javascript使页面跳转到特定位置 [英] Javascript to make the page jump to a specific location

查看:573
本文介绍了Javascript使页面跳转到特定位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在javascript中有一种方法可以让页面跳转到页面上的特定位置,例如

I there a way in javascript to make the page jump to a specific location on the page, such as

<span id='jump_to_this_location'></span>

我不想重新加载页面,

推荐答案

您可以设置 location.hash 属性,如下所示:

You can set the location.hash property, like this:

window.location.hash = "jump_to_this_location";

你可以在这里尝试一下

这篇关于Javascript使页面跳转到特定位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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