kusanagi kusanagi - 1 year ago 98
Javascript Question

jquery Treeview highlighting selected item

i read docs


also googled, but nothing found easy and good solution, how to highlighting the selected item. i use span so not redirect but nothing selected

Answer Source

You can select li items in the tree and add event listeners to them, like this:

$('#browser li.file').bind('click', function() {
  //clear all clicked items if any
  //set this clicked

Inside handler function 'this' word points to the clicked item. Or if by 'selecting' you mean something else, you can also listen desired event type like in example.

$('#browser li.file').bind('mouseover', function() {
 ... your code ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download