jstree上没有明确默认点击事件时如何触发点击事件
使用jstree,我使用下一个代码来触发单击,但是,我看不到默认的单击事件,例如:单击时的蓝色背景,
这是我的代码:
<div id="wrap">
<div id="header">header</div>
<div id="main">
<div id="demo1" style="float:left;width:50%;">
<ul>
<li>
<a id='a' href="">aaa</a>
<!-- UL node only needed for children - omit if there are no children -->
<ul>
<li><a id="a_1" href="#"> bbb</a></li>
<li><a id="a_2" href="#"> ccc</a></li>
</ul>
</li>
</ul>
</div>
<div id="content">www</div>
</div>
</div>
<div id="footer">
footer
</div>
<script type="text/javascript">
$(function () {
$("#demo1").jstree({
"themes": {
"theme": "default",
"dots": true,
"icons": true,
"url": "themes/default/style.css"
},
"plugins" : [ "themes", "html_data" ]
});
$('#a_1').click(function(){
$('#content').html('bbb \'s content')
//return false;
})
$('#a_2').click(function(){
$('#content').html('ccc \'s content')
//return false;
})
});
</script>
我找到了一些这样的代码:
.bind("create.jstree", function (e, data) {
alert(data)
})
其含义是:警报数据当有人创建一个新文件时,
?
jstree有像“click.jstree”这样的方法吗
谢谢
using jstree, i use the next code to Trigger click , but , i can not see the defalut click event, like : the blue background when i click ,
this is my code :
<div id="wrap">
<div id="header">header</div>
<div id="main">
<div id="demo1" style="float:left;width:50%;">
<ul>
<li>
<a id='a' href="">aaa</a>
<!-- UL node only needed for children - omit if there are no children -->
<ul>
<li><a id="a_1" href="#"> bbb</a></li>
<li><a id="a_2" href="#"> ccc</a></li>
</ul>
</li>
</ul>
</div>
<div id="content">www</div>
</div>
</div>
<div id="footer">
footer
</div>
<script type="text/javascript">
$(function () {
$("#demo1").jstree({
"themes": {
"theme": "default",
"dots": true,
"icons": true,
"url": "themes/default/style.css"
},
"plugins" : [ "themes", "html_data" ]
});
$('#a_1').click(function(){
$('#content').html('bbb \'s content')
//return false;
})
$('#a_2').click(function(){
$('#content').html('ccc \'s content')
//return false;
})
});
</script>
i find some code like this :
.bind("create.jstree", function (e, data) {
alert(data)
})
its mean is : alert data when someone cerate a new file ,
so
does jstree has a method like "click.jstree" ?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你所拥有的在事件方面很好,你只是缺少一个插件......在新的 1.0 模型中,ui 位是一个单独的插件,如果你只是将你的插件从这里更改
为:
你将得到当前节点选择着色,您可以在这里尝试一下。
What you have is fine on the events side, you're just missing a plugin...in the new 1.0 model the ui bits are a separate plugin, if you just change your plugins from this:
To this:
You'll get the current node selection coloring, you can give it a try here.