Three implementation methods of html anchor points

PHPz
Release: 2017-04-03 16:57:56
Original
4846 people have browsed it

Anchors are often used in web pages, especially in relatively long pages. The use of anchors will increase the user experience. Now PHP Chinese website introduces three implementation methods of html anchors.

1. In the same page


Jump to add
2. In different pages, the anchor point is positioned in a.html, from another page The link jumps to this anchor point
Jumps to a.add
3. Click the link to trigger the js event and jump to the anchor at the same time Click, there are two ways to handle it:
The first one:
Trigger the add function and jump to the add anchorSecond type: