the active class is not deleted when another button is clicked.
<ul class="nav nav-tabs text-center" id="cTabs" > <li><a href="/" class="active">bütün mallar</a></li> <?php foreach ($categories as $categoryItem): ?> <li > <a href="/category/<?php echo $categoryItem['id']; ?>" class="" > <?php echo $categoryItem['name']; ?> </a> </li> <?php endforeach; ?> </ul> here is the script:
$("#cTabs li a").click(function(){ $("#cTabs li a .active").removeClass("active"); $(this).addClass("active"); });
li, and you click, most likely, ona...... by the way, in the end, you also add anactivetoli- Aleksey Shimanskya .active....... the space does not confuse? Although there generally should just be$("#cTabs li a").removeClass("active");Just in case, to remove the activity from all - Alexey Shimansky