I'm having a problem, after implementing a jQuery in-page tab navigation system, with how to redefine my page names, so that they can be styled as "active" in my main navigation.
I use:
<?php $var_page_name = 'example.php'; ?>
to define each page name on my web site, with example replaced with the correct page name.
I then use the following to style the "active" page in the navigation, with the active class defined using CSS:
<?php global $var_page_name; ?>
<ul>
<li><a<? if($var_page_name == 'index.php') print ' class="active"'; ?> href="index.php">web design</a></li>
</ul>
Works great. I've added an in-page jQuery tabbing solution for navigation. Which also works.
However, after clicking on one of the tabs and going to the new content div, its seems that the page name changes, so the correct main navigation item is no longer considered active. The url reads as http://www.example.com/index.php#, but if I modify my active page navigation variable to read:
<a<? if($var_page_name == 'index.php' || $var_page_name == 'index.php#' ) print ' class="active"'; ?>
or try the div id that is being used by the tabs:
<a<? if($var_page_name == 'index.php' || $var_page_name == 'index.php#content_2' ) print ' class="active"'; ?>
it doesn't fix the problem. Any suggestions?