Blocksy Tutorial: Anchor Navigation Effects and Menu Highlighting

Single page websites are becoming more and more popular, there is no need to switch pages and all information is presented in one page. However, when the page content becomes longer, it is difficult for visitors to quickly jump to a specific area. This is where the use ofAnchor Navigationto enhance the browsing experience.

This article describes the use of Blocksy Topics + Gutenberg editor (software) Implement a method for page anchor jumps and menu highlighting via a plugin.

图片[1]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

I. What is anchor point navigation?

Anchor navigation is a technique that smoothly scrolls the page to a specific content area after clicking on a menu and is commonly used:

  • Single page website (One Page Layout)
  • Campaign or product landing pages
  • Long content display page (e.g. service flow, company profile)

Second, the basic operation: the rapid realization of anchor jumps

1. Creating pages and blocks

exist Gutenberg Creates a new page in the "About Us" section and adds several content blocks to simulate the structure of the page (e.g. "About Us", "Services", "Contact Us", etc.).

图片[2]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

2. Setting anchor markers

Click on each title or block, right sidebar > Advanced > Fill in HTML Anchor fields (for example:about-us,services).

图片[3]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

3. Creating navigation menus

Go to the backstage:Appearance > Menu, perform the following operations:

  • Create a new menu
图片[4]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果
  • Add a "custom link" in the format of # Anchor Name(e.g. #about-us)
  • Name the link title (e.g. "About Us")
图片[5]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果
  • Save and set menu as header navigation
图片[6]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

4. Test the page jump effect

Visit the front page and click on a menu item and the page will smoothly jump to the corresponding content area.

图片[7]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

Third, advanced features: the realization of the menu highlighting effect

Description of the problem

WordPress Native does not support "current item highlighting" for anchored menu items, and the navigation does not automatically follow the user when scrolling the page.

Solution: Use the Page scroll to id plugin

Step 1: Install the plug-in

Go to the backstage:Plugins > Install Plugins
Search and install Page scroll to id Plugin, activated and enabled

图片[8]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

Step 2: Configure Plug-in Parameters

Go to the plugin setup page and recommend the following configuration:

  • Highlighted class Set to:ct-highlight(Blocksy (support for this style class)
图片[9]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果
  • Enable:
    • "Allow only one highlighted menu item"
    • "Keep the current item highlighted until the next one appears."
图片[10]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

Save the settings.

IV. Verification of final results

Refresh the front page to test:

  • Click on the navigation menu and the page smoothly jumps to the designated area
图片[11]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果
  • When scrolling, the menu item corresponding to the current content block is automatically highlighted.
图片[12]-Blocksy 单页网站教程:实现锚点跳转与菜单高亮效果

This feature is particularly suitable for creating one-page websites or promotional pages with a high level of sophistication and interactivity.

V. Summary

leverage Blocksy respond in singing Gutenberg editor, combined with the Page scroll to id plugin that can be easily implemented:

  • Page Anchor Jump
  • Customize navigation menu links
  • Scroll to highlight the current menu item

Without any code, it quickly improves page interaction experience and professionalism, which is very suitable for service introduction page, work display page or marketing landing page.

Recent Updates


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
客服微信
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: [email protected]
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
本文作者:托尼屎大颗
THE END
If you like it, support it.
kudos1213 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments