Skip to main content

Bug Tracker

Side navigation

#166 closed bug (invalid)

Opened September 01, 2006 11:35AM UTC

Closed September 14, 2006 02:43AM UTC

Last modified June 21, 2007 04:03AM UTC

nth-of-type

Reported by: anonymous Owned by:
Priority: major Milestone:
Component: ajax Version:
Keywords: nth-of-type problem Cc:
Blocked by: Blocking:
Description

I have this function:

function menu_bar() {

var url = document.location.href;

var parametro = url.substring(url.indexOf('?')+1,url.length);

var arrayParams=parametro.split('&');

for (var i=0;i<arrayParams.length;i++){

if (arrayParams[i].substring(0,arrayParams[i].indexOf('=')) == 'categoria') {

var numBer = (arrayParams[i].substring(arrayParams[i].indexOf('=')+1,arrayParams[i].length)-1);

$("#navigation-continguts ul.small-menu>li:nth-of-type('"+numBer+"')").find("h2").addClass("on");

$("#navigation-continguts ul.small-menu>li:nth-of-type('"+numBer+"')").find("div.menu_go_button").addClass("on");

}

}

}

and the followin' html code:

<div id="navigation-continguts">

<ul class="small-menu">

<li>

<div class="box-container">

<div class="box-title">

<h2>Documentos</h2>

<div class="menu_go_button off"></div><a href="?categoria=1">Documentos</a>

</div>

</div>

</li>

</ul></div>

Note that there are 4 <li>s inside the UL

So the problem is that I cant set the class to the H2 and div.menu_go_button

if im using the old version of jquery, i mean differetn than 1.0 or 1.01 everything is workin correctly, but the problem is that im using prototype too in the same document and its messign' somethin', so i chaneged to jquery 1.01 and now i cant get applied these classes.

if there soem problem workin with nth-of-type ?

Donno if my explication is good, but i would liek u to help me

Attachments (0)
Change History (1)

Changed September 14, 2006 02:43AM UTC by john comment:1

resolution: → invalid
status: newclosed
version: 1.0b1

nth-of-type was removed from jQuery in 1.0. I recommend that you try nth-child, which (according to your example) will suit you just fine.