Jörn Zaefferer escreveu:
>
> Gerson Goulart schrieb:
>> Hi all!
>>
>> I'm not a programmer (and don't speak English), but I'm trying to do
>> both. =D
>>
>> I'm looking for a simple solution to do a simple tree menu like the
>> Windows Explorer during some days. All solutions I find are terible,
>> in my opinion (including dtree ) :p
>>
>> I decided to do a very simple tree menu using JQuery and HTML
>> unnordered list. However I only applyed the funtionality in the first
>> <li><ul> node. (Do you can comprehend what I'm speaking?)
>>
>> Can someone help me?
>>
> Have you ever looked at my treeview plugin?
> http://dev.jquery.com/view/trunk/plugins/treeview/
>
> It may still need a bit CSS tuning, but otherwise its running fine.
> I'm nearly there to release a new version that includes both location
> and cookie based persistance. And you can add nodes to the tree.
>
> -- Jörn
>
Your treeview sounds realy interesting! Good Job!
I analyzed prudent all the code and really I liked. However I find that
it is much sophisticated for my present need... I am making an effort to
have a code with the maximum of 10 lines.
I looked in jquery.treeview.js for a solution to fix my code, but it is
very complicated to my knowledge about javascript/jQuery.
Anyway I very thank the hint. Really it is a very good work. Some day I
will know to program like this ;)
There I need alone uncover because the line:
$("#body-menu-div li>ul").parent().each(function() {
does not catch every <li> that contains an <ul> on this code:
<script type="text/javascript">
$(document).ready(function(){
$("#body-menu-div li>ul").parent().each(function() {
$(this).toggleClass("hide")
$(this).html( "<a href=\"#\" class=\"expand\"></a>" + $(this).html() );
$(this).children(".expand").click(function() {
$(this).toggleClass("collapse")
$(this.parentNode).toggleClass("show")
});
});
});
</script>
Thanks,
Gerson.