使用下面的树形导航脚本,如何使标题触发下拉?
我们使用以下脚本进行下拉导航:
http:// www.onlinetools.org/tools/dom-tree-menu-puredom/#
但是,只有单击 [+] 或 [-] 时才会触发下拉菜单。我们希望标题本身触发下拉菜单。例如:
[+] Heading
[+] Heading 2
[+] Heading 3
当我们单击 [+] 和“标题”一词时,我们希望下拉列表显示如下:
[-] Heading
-- Content 1
-- Content 2
-- Content 3
[+] Heading 2
[+] Heading 3
目前,只有 [+] 触发下拉列表,而“标题”仅允许我们放置普通链接。
We're using the following script to have a dropdown navigation:
http://www.onlinetools.org/tools/dom-tree-menu-puredom/#
However, the drop down is only triggered when the [+] or [-] is clicked. What we like to happen is for the headings themselves to trigger the dropdown. Like:
[+] Heading
[+] Heading 2
[+] Heading 3
When we click on [+] and also the word "Heading" we like the drop down list to appear like so:
[-] Heading
-- Content 1
-- Content 2
-- Content 3
[+] Heading 2
[+] Heading 3
Currently, only the [+] triggers the drop down and "Heading" merely allows us to put a normal link.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
linkParent:false
更改为linkParent:true
如果您将其更改为 true,我有一种感觉,也将允许标题进行链接。
如果你看一下第 41 行,它会设置点击处理程序。第一个标签 [0] 是箭头,第二个标签 [1] 我相信是标题
提示:他们在脚本的开头也有一个很好的注释。
linkParent:false
change tolinkParent:true
If you change that to true I have a feeling that will allow the heading to do the linking too.
If you take a look at line 41 it sets the click handler. The first a tag [0] is the arrow and the second a tag [1] I believe is the title
Hint: They also have a nice comment in the beginning of the script.