JSTree 列表和锚点

JSTree list and anchor

嘿伙计们,我需要一些帮助我有一个 JSTREE,其中一些重定向到我的 html 网页的一部分 我正在尝试找出现在可以提供帮助的 jstree 函数,我有这个: http://pastebin.com/ZTSYXWpt

这是 html 法文代码:http://pastebin.com/TpLhWASp 现在发生的事情是,如果我单击一个名为第 1 节或第 2 节或第 3 节或 wtv 编号的节点,它会将我重定向到节点本身而不是 href link 而不是位于李 有什么帮助吗?

(我可以在没有 jstree 的情况下点击带有锚点的 link 并将页面上的用户重定向到该部分,但我无法使用 jstree 做到这一点)

这是一个功能,当您单击它时,它会将您重定向到 html 页面中的指定部分

$(document).ready(function() {
$('div').eq(0).jstree();
$("#catTree li").on("click", "a", function() {

    document.location.href = this;
});

});

这是在 html

中创建列表的 html 代码的一部分
    <body>
    <h1>Categorie</h1>
    <div id="catTree">
        <ul class="n1">
            <span>Liste Categorie</span>
            <li>
                Categorie
                <ul class="n2">
                    <li>
                        <a class="menu" href="#section1">Section 1</a>
                    </li>
                    <li>
                        <a  class="menu" href="#section2">Section 2</a>
                    </li>

这是当你点击 JStree 节点时它应该指向你的地方

            <header>

            <p>
                Nom fabricant
            <p>
                <a name="section1"> Section 1</a>
        </header>
        <br>
        <figure>
            <p>
                description1
            </p>
            <figcaption>
                blabla
            </figcaption>
            <img src="images/hat1.jpg" alt="hat"/>
        </figure>
        <br>
        <footer>
            <p>
                Prix : 00$$
            </p>
            <a href= "#section12"> Dernière section</a>
        </footer>

更清晰的代码,如果你想了解更多信息,请进入 html pastebin 文件,但如果你查看它,有 12 个部分完全相同,我希望那些 jstree 节点重定向到那些部分

似乎是 How to get I get leaf nodes in jstree to open their hyperlink

的复制品

勾选http://codepen.io/anon/pen/gPryPR

$('div#catTree').jstree().bind("select_node.jstree", function (e, data) {
    var href = data.node.a_attr.href;
    document.location.href = href;
});