介紹
官網:https://wpsticky.com/
The WP Sticky Menu (or Sticky Header) On Scroll plugin allows you to make any element on your pages “sticky” as soon as it hits the top of the page when you scroll down. Although this is commonly used to keep menus at the top of your page to create floating menus, the plugin allows you to make any element sticky. Make a sticky header, stick menu, sticky widget (fixed widget), sticky logo, sticky call to action or a floating menu. You just need to know how to pick the right selector for the element you want to make sticky, and you need to be sure it’s a unique selector. Sometimes a simple selector like “nav”, “#main-menu”, “.menu-main-menu-1” is enough. Other times you will have to be more detailed and use a more specific selector such as “header > ul:first-child” or “nav.top .menu-header ul.main”. If you don’t like messing with any code check out out the visual element picker in WP Sticky PRO. 產品特點 Any element can stick: although common use is for navigation menus, or header the plugin will let you pick any unique element with a name, class or ID to stick at the top of the page once you scroll past it. Use it for sticky widget, sticky sidebar, sticky header, sticky menu, sticky header, sticky call-to-action box, sticky banner ad, etc. Need to make multiple elements sticky? Check out WP Sticky PRO. Positioning from top: optionally, you can add any amount of space between the sticky element and the top of the page, so that the element is not always stuck at the “ceiling” of the page. Enable for certain screen sizes only: optionally, you can set a minimum and/or maximum screen size where the stickiness should work. This can be handy if you have a responsive site and you don’t want your element to be sticky on smaller screens, for example. Enable only on some pages: sometimes you don’t want the element to be sticky on the entire site. WP Sticky PRO gives you the option to pick posts, pages, categories, tags and CPTs where you don’t want the element to be sticky. Push-up element: optionally, you can pick any other element lower on the page that will push the sticky element up again (for example a sidebar widget). Admin Bar aware: checks if the current user has an Admin Toolbar at the top of the page. If it has, the sticky element will not obscure it (or be obscured by it). Z-index: in case there are other elements on the page that obscure or peek through your sticky element, you can add a Z-index easily. Legacy Mode: in 2.0, a new method of making things sticky was introduced. In Legacy Mode, the old method will be used. See FAQ for details. Dynamic Mode: some issues that frequently appear in responsive themes have been address by adding a Dynamic Mode (Legacy Mode only). See FAQ for details. Debug Mode: find out possible reasons why your element doesn’t stick by switching on Debug Mode, and error messages will appear in your browser’s console. |
翻譯:
WP的菜單(或粘頭)滾動插件允許你做任何頁面元素“粘性”就會變當你向下滾動頁面的頂部。雖然這是常用來保持菜單頁面的頂部創建浮動菜單,粘性插件允許你做任何元素。粘性的頭,把菜單,粘性小部件(固定部件),粘標誌,粘稠的行動號召或浮動菜單。 你只需要知道如何選擇正確的元素的選擇你想要粘,你需要確定它是一個獨特的選擇器。有時一個簡單選擇符如“導航”、“#主菜單”,”。menu-main-menu-1”就足夠了。有時你必須更加詳細和使用一個更具體的選擇器,如“頭> ul:第一個孩子”或“導航。頂級.menu-header ul.main”。如果你不喜歡改變任何代碼檢查出視覺元素選擇器在WP粘性PRO。 產品特點 任何元素都可以貼:儘管常用導航菜單,或者頭插件會讓你p |
安裝和使用
1、安裝並啟用
2、進入後台菜單:設置->“STICKY MENU (OR ANYTHING!)”
3、找到想要置頂的元素。
1)Sticky Element: (required):
相關插件:Custom Sidebars – Dynamic Sidebar Widget Area Manager