You could try something like this:
function filterPath(pathString) {
return pathString.replace(/^\//,'').replace(/\/(index\.\w{3,4})?
$/,'')
}
$('a').filter(function() {
return filterPath(this.pathname) == filterPath(location.pathname);
}).addClass('active');
Then, style an active class
No one can help?
I tought with jquery one can select everything!
Hi Adrian,
thanks for your help but I can't follow you. I have no directories to
split - but if, this is a good solution.
I think the problem occurs here:
$('#navigation [EMAIL PROTECTED]"' + path + '"]')
The @href finds all elements which contains the path (filename). And
if filename 1 is pota
Hi Adrian,
thanks for your help but I can't follow you. I have no directories to
split - but if, this is a good solution.
I think the problem occurs here:
$('#navigation [EMAIL PROTECTED]"' + path + '"]')
The @href finds all elements which contains the path (filename). And
if filename 1 is pota
Extract the href and then split it into it's various sections
var href = some selector;
hrefSections = href.split("/");
If there are no query string parameters you have the file name in the
last array element:
var fileName = hrefSections[hrefSections.length - 1];
Now do your other selector a
5 matches
Mail list logo