working with laravel 5.6 and develop sidemenu bar with bootstarp. I am using request to highlight current menu items here. but it is not highlight when it is in current menu.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
.nav-sidebar li.active{
/*your css code here*/
}
</style>
<li class="">
<a href="{!! route('products.index') !!}"><span>Products</span></a>
</li>
<li class="">
<a href="{!! route('tags.index') !!}"><span>Tags</span></a>
</li>
<li class="">
<a href="{!! route('items.index') !!}"><span>Items</span></a>
</li>
<script>
$('.nav-sidebar').on('click','li', function(){
$(this).addClass('active').siblings().removeClass('active');
});
</script>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire