Hello, I am using the jQuery Treeview plugin. Have a look to the "Sample 1 - default" provided on the demo page of the plugin http://jquery.bassistance.de/treeview/demo/. In my case all folders and files are links. If I click for example on the expanded "Folder 2" it will first collapse and then follow to the link location. The behaviour I would like to is, that only collapsed ones will expand first and if it already expanded it will stay like this.
The code in the plugin (jquery.treeview.js) which toggle the behaviour is the following:
66 this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) {
67 toggler.apply($(this).next());
68 }).add( $("a", this) ).hoverClass();
I already figured out how to get all the links, which should be changed:
$('a').parent().parent().filter('.collapsable')
The result will be a array of all li which are currently collapsable (expanded): [li., li.collapsable]
But I don't know how to proceed from there :-( Hopefully someone could help me along...
I already changed sucessfully the linkbehavior for the current selected (class=selected) link with this code:
$(".current").click(function(e){
e.preventDefault();
});
Many thanks in advance!