简体   繁体   中英

How to jump from page 1 to the specific section in page 2 if there are no anchor tags

How to jump from page 1 to the specific section in page 2 if there are no anchor tags in page 2 .. Tried with <a href=#sectionname but no sign of hope.

Please help

You'll need to no the x / y position of the section on page 2 but look at this:

http://www.w3schools.com/jsref/met_win_scrollto.asp

Should work provided you have those details.

in page 1 you should have a link (anchor tag) to page 2

<a href="page2.html#yoursection">

in page 2 you need to have a tag with id="yoursection" eg

<div id="yoursection">

that should work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM