`
songjindian
  • 浏览: 73920 次
  • 性别: Icon_minigender_1
  • 来自: 河南
文章分类
社区版块
存档分类
最新评论

页面手动添加描点

阅读更多

html,jsp等页面内可以设置锚点,锚点定义

<a name="firstAnchor">&nsbp;</a>  
 

锚点使用

<a href="#firstAnchor">跳至第一个锚点</a> 
 

但对于js呢,在js中如何在完成一个操作后跳至页面的某个固定锚点呢

js中location.href可以跳转至某个url;

 

跳至(定位到)某个固定锚点的办法

1、location.href = "#firstAnchor";       // firstAnchor为锚点名称

2、window.location.hash = firstAnchor; // firstAnchor为锚点名称

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics