Hello, I have 2 navigations ( mainnav and subnav ) with 2 lists List have same names ( li0 li1 li2 ) What is the best way to select li1 of subnav with prototype 1.4 in this case ? I just want to hide/show it Thanks <div id="mainnav"> <ul> <li name="li0"><li name="li1"><li name="li2"> </ul> </div> <div id="subnav"> <ul> <li name="li0"><li name="li1"><li name="li2"> </ul> </div>
Hi oo00oo (!)
"name" is not a standard attribute for li elements.
You should use class instead.
<li class="li0"></li>
Then with prototype :
var my_elements = document.getElementsByClassName(''li0'');
Hope this helps,
Nicolas Terray
On 3/15/06, oo00oo <oo00oo-GANU6spQydw@public.gmane.org>
wrote:> Hello,
>
> I have 2 navigations ( mainnav and subnav ) with 2 lists
> List have same names ( li0 li1 li2 )
>
> What is the best way to select li1 of subnav with prototype 1.4 in this
> case ? I just want to hide/show it
>
> Thanks
>
> <div id="mainnav">
> <ul>
> <li name="li0"><li name="li1"><li
name="li2">
> </ul>
> </div>
>
> <div id="subnav">
> <ul>
> <li name="li0"><li name="li1"><li
name="li2">
> </ul>
> </div>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
Thanks
but I have 2 class ( li0 ) one under div "main" and another under div
"subnav"
So what I need is more
$(''ssnav'').getElementsByClassName(''li0'');
But return the error
Error : $("ssnav").getElementsByClassName is not a function
So, how select it ?
> Hi oo00oo (!)
>
> "name" is not a standard attribute for li elements.
> You should use class instead.
> <li class="li0"></li>
> Then with prototype :
> var my_elements = document.getElementsByClassName(''li0'');
>
> Hope this helps,
> Nicolas Terray
>
> On 3/15/06, oo00oo <oo00oo-GANU6spQydw@public.gmane.org> wrote:
>
>> Hello,
>>
>> I have 2 navigations ( mainnav and subnav ) with 2 lists
>> List have same names ( li0 li1 li2 )
>>
>> What is the best way to select li1 of subnav with prototype 1.4 in this
>> case ? I just want to hide/show it
>>
>> Thanks
>>
>> <div id="mainnav">
>> <ul>
>> <li name="li0"><li name="li1"><li
name="li2">
>> </ul>
>> </div>
>>
>> <div id="subnav">
>> <ul>
>> <li name="li0"><li name="li1"><li
name="li2">
>> </ul>
>> </div>
>> _______________________________________________
>> Rails-spinoffs mailing list
>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>>
>>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
document.getElementsByClassName(''li0'',
''ssnav'');
On 3/15/06, oo00oo <oo00oo-GANU6spQydw@public.gmane.org>
wrote:> Thanks
> but I have 2 class ( li0 ) one under div "main" and another under
div
> "subnav"
>
> So what I need is more
$(''ssnav'').getElementsByClassName(''li0'');
>
> But return the error
> Error : $("ssnav").getElementsByClassName is not a function
>
> So, how select it ?
>
> > Hi oo00oo (!)
> >
> > "name" is not a standard attribute for li elements.
> > You should use class instead.
> > <li class="li0"></li>
> > Then with prototype :
> > var my_elements =
document.getElementsByClassName(''li0'');
> >
> > Hope this helps,
> > Nicolas Terray
> >
> > On 3/15/06, oo00oo <oo00oo-GANU6spQydw@public.gmane.org> wrote:
> >
> >> Hello,
> >>
> >> I have 2 navigations ( mainnav and subnav ) with 2 lists
> >> List have same names ( li0 li1 li2 )
> >>
> >> What is the best way to select li1 of subnav with prototype 1.4 in
this
> >> case ? I just want to hide/show it
> >>
> >> Thanks
> >>
> >> <div id="mainnav">
> >> <ul>
> >> <li name="li0"><li
name="li1"><li name="li2">
> >> </ul>
> >> </div>
> >>
> >> <div id="subnav">
> >> <ul>
> >> <li name="li0"><li
name="li1"><li name="li2">
> >> </ul>
> >> </div>
> >> _______________________________________________
> >> Rails-spinoffs mailing list
> >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> >>
> >>
> > _______________________________________________
> > Rails-spinoffs mailing list
> > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> >
> >
> >
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
Reasonably Related Threads
- [LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
- [LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
- [LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
- [LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
- Rails 3 - Loading a Subnav with Ajax… Which controller owns a subnav?