PDA

View Full Version : Javascript Question


foto41
Feb-16-2010, 12:48 PM
I have been using a Hide Catagories command in my Java for a while, and it has worked to hide catagories that are also in my Navbar. Something has broken and I cannot figure out what.
Portfolio, and 2-Wheels are hidden, but the rest is visable. The only thing I can figure is the %20 has stopped working.
Could someone please look at this code for me.

My site is foto41.com

// Hide Categories
function delCategory() {
re = /\/(Client%20Galleries|2-Wheels|Lone%20Star%20Track%20Days|Portfolio)$/;

var oList = YD.getElementsByClassName('miniBox', 'div', this);

for (i = 0; i < oList.length; i++) {
if (re.test(oList[i].getElementsByTagName('a')[0].href))
oList[i].parentNode.removeChild(oList[i]);
}
}
YE.onContentReady('categoriesBox', delCategory);
// End Hide Categories

foto41
Feb-16-2010, 02:02 PM
Well, I renamed the Catagories, leaving out any spaces to eliminate the need for the %20 in the spaces. That fixed the problem, but if anyone has any idea why that stopped working I would like to hear it. Thanks!!