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