Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Active class in menu section

// active class in menu section
// first
@php
    $route = Route::current()->getName();
@endphp
// 2nd
<li class="{{ ($route == 'home') ? 'active' : ''  }}"><a href="{{ route('home') }}">Home</a></li>
Source by developer.wordpress.org #
 
PREVIOUS NEXT
Tagged: #Active #class #menu #section
ADD COMMENT
Topic
Name
8+8 =