开发者

On page load - how to go to page anchor [closed]

开发者 https://www.devze.com 2023-02-06 15:19 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_StackOverflow Closed 10 years ago.

I have an url like that ../page/5/product

This page have anchors to ../page/5/product/10#anchor01 , ../page/5/product/8#anchor01 etc.

How is it possible to jump, after the page is loaded, to the anchor displayed on the new page.

Hope someone could give me a hint.


Changing the value of hash of the location object will automagicly lead you to the anchor.

location.hash = "#anchor";
0

精彩评论

暂无评论...
验证码 换一张
取 消