http://trinea.iteye.com/blog/980446
html页面内可以设置锚点,锚点定义
- <aname="firstAnchor">&nsbp;</a>
锚点使用
- <ahref="#firstAnchor">跳至第一个锚点</a>
但对于js呢,在js中如何在完成一个操作后跳至页面的某个固定锚点呢
js中location.href可以跳转至某个url;
跳至(定位到)某个固定锚点的办法
1、location.href = "#firstAnchor"; // firstAnchor为锚点名称
2、window.location.hash =firstAnchor; // firstAnchor为锚点名称