jQuery: The Write Less, Do More JavaScript Library

:path

Average rating
(1 vote)

:path is a pseudo-class selector written in jquery. It automatically filters out href attributes that matches the window location and it's ancestors. Use it to style or modify active states in navigations without server-side interaction.

Usage (example):
$('ul a:path').parent().addClass('active');

Comes bundled with the similar selector :current that filters out hrefs that points to the very same page that the window.location returns.

Releases

Official releasesDateSizeLinksStatus
1.02008-May-035.47 KBRecommended for 1.0.xThis is currently the recommended release for 1.0.x.