So I chose to implement a simpler navi bar just for the start and read up on the other one later.
The bar works perfectly when tested in isolation but on the php site it resets when I order the table.
The way I order the table is by using a variable [PHP$order_var[/PHP] which changes the php extension at the top.
Since the nav bar is resetting everytime I click an items I assume the page is refreshing in a way?
Is it even possible to make something like that work?
Here is the javascript I am using
Code:
$(document).ready (function() {
$("a.cp_btns").click(function() {
$("a.cp_btns.active").removeClass("active");
$(this).addClass("active");
});
});
And here is the setup
Code:
div id="cp_menu" >
<a class="cp_btns "<?php echo'<a href="indexB.php?order_var=' . $id_var . '"';?>>Most Recent</a></a>
<a class="cp_btns" <?php echo'<a href="indexB.php?order_var=' . $fn_var . '"';?>>Best Rated</a></a>
<a class="cp_btns" <?php echo'<a href="indexB.php?order_var=' . $ln_var . '"';?>>Most Viewed</a></a>
</div>
Thank you
Shibbs
Bookmarks