繁体   English   中英

单击某些文件时如何使用jstree在正确的div中显示内容

[英]how to use jstree to show content in right div when i click some file

树形文件位于左侧,内容div位于右侧,如何显示

右边div上的一些数据,

这是我的代码:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jsTree v.1.0 - full featured demo</title>
    <script type="text/javascript" src="_lib/jquery.js"></script>
    <script type="text/javascript" src="_lib/jquery.cookie.js"></script>
    <script type="text/javascript" src="_lib/jquery.hotkeys.js"></script>
    <script type="text/javascript" src="jquery.jstree.js"></script>
    <link rel="stylesheet" type="text/css" href="_docs/!style.css" />
    <style type="text/css">
    html, body { margin:0; padding:0; }
    body, td, th, pre, code, select, option, input, textarea { font-family:verdana,arial,sans-serif; font-size:10px; }
    .demo, .demo input, .jstree-dnd-helper, #vakata-contextmenu { font-size:10px; font-family:Verdana; }
    </style>
</head>
<body>
<div id="demo1" style="float:left;width:50%;">
    <ul>
        <li>
            <a href="">aaa</a>
            <!-- UL node only needed for children - omit if there are no children -->
            <ul>
                <li><a href=""> bbbb</a></li>
                <li><a href=""> cccc</a></li>
            </ul>
        </li>
    </ul>

</div>
<div id="content">www</div>
<script type="text/javascript">
    $(function () {
    $("#demo1").jstree({ 
        "themes": {
        "theme": "default",
        "dots": true,
        "icons": true,
        "url": "themes/default/style.css"
      },

        "plugins" : [ "themes", "html_data" ]
    });
});
</script>
</body>
</html>

谢谢

尝试使用类似http://jsfiddle.net/HthRD/1/的方法 -具体内容将根据您要写入其他“窗格”的内容而有所不同。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM