jQuery Automatically Highlight Current Page

jQuery Automatically Highlight Current Page is moved here https://www.allphptricks.com/jquery-automatically-highlight-current-page/


4 thoughts on “jQuery Automatically Highlight Current Page

  1. I just put this code in top auto content

    $( function () {
    var pathname=(window.location.pathname.match(/[^\/] $/)[0]);
    $( ‘.navigation a’).each( function() {
    if ($(this). attr(‘href’)==pathname)
    $(this).addClass( ‘active’);

    <style type="text/css">
    #wrapper {margin :1px;}
    .navigation {padding :1px;}
    .navigation a {color:red; text-decoration:none;}
    .active{background:yellow; color:#530;}



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s