jQuery跳转到id(无动画) [英] jQuery jump to id (no animation)

查看:92
本文介绍了jQuery跳转到id(无动画)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

脚本为块添加了id,给出:

Script adds id for block, gives:

<div id="some">Text</div>


在那之后,页面应该跳转到该id ,而没有动画,就像我们在当前页面链接上有目标#some一样.


After that page should jump for that id, without animation, just like we have target #some on current page link.

该怎么做?

谢谢.

推荐答案

您是说像#some

例如

<a href="#some"></a>

使用

location.href = "#some"; 

这篇关于jQuery跳转到id(无动画)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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