hypejunction / menus_dropdown
此软件包已被弃用,不再维护。未建议替代软件包。
Elgg 的下拉菜单
2.0.0
2017-02-23 17:17 UTC
Requires
- php: >=5.5
- composer/installers: 1.*
This package is auto-updated.
Last update: 2020-01-29 03:10:06 UTC
README
功能
- 通过简单地将
elgg-menu-item-has-dropdown
添加到父菜单项的类中,将任何子菜单转换为下拉菜单
使用方法
要将子菜单转换为下拉菜单,只需将 elgg-menu-item-has-dropdown
类添加到您的菜单项中。每次点击父菜单项时,子菜单都会在悬停菜单中显示
elgg_register_menu_item('entity', array( 'name' => 'parent', 'href' => '#', 'text' => 'Parent item', 'item_class' => 'elgg-menu-item-has-dropdown', // controls the position relative to the trigger 'data-position' => json_encode([ 'my' => 'right top', 'at' => 'right bottom+5px', ]), // popup appear in a fixed position and detached from the original DOM position // you can add an additional class to have more control over styling 'data-popup-class' => 'elgg-menu-entity-popup', 'data-collision' => 'fit fit', )); elgg_register_menu_item('entity', array( 'name' => 'child', 'parent_name' => 'parent', 'href' => '/child', 'text' => 'Child item', ));