I have a nav menu bar based on twitter bootstrap that I want to apply scrollspy to for hightlighting. i include the menu into multiple pages using a normal php include. therefore I am linking to files using their filename plus bookmark (e.g. products.php#foo).
but the way that scrollspy wants urls to work is to use the format <a href="#id-of-target">my link</a>
, so that when <div id="id-of-target">
scrolls into view, the href is matched based on the href attrib and gets the active class put on it.
which means that if I have a link like <a href="products.php#my-catalogue">my catalogue</a>
then it won't match the id and the link won't highlight.
i couldn't work out how to modify scrollspy so that it only matches on the id after the #
in the href value.