开发者

jquery treeview click on node or +

i use jquery treeview http://docs.jquery.com/Plugins/Treeview/treeview

i want to catch click on text node and do something i use such code

$('li').live('click', function(){ ale开发者_开发百科rt(this.id); return false; });

but if i click on '+' it calls my js code, and then node expand. how can i blocked to call my js code? i know about call e.stopImmediatePropagation(); but how can i use it here?


Try this $('li').live('click', function(event){ event.stopPropagation(); alert(this.id); return false; });


If you are still choosing tools for your task, you should try jsTree, a jQuery plugin with plenty of resources and configuration options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜