set active link with jquery in multipage page : i know its not the first question.
i try from http://stackoverflow.com/questions/14039968/jquery-make-a-link-in-active-status.
but its not working, when i click to go different page the 'a' didnt have class active.
here my link.
any suggestion thanks.

    <nav class="main-navi">
            <ul>
                <li>
                    <a href="index.html">
                        Home
                        <span class="dot"></span>
                        <span class="corner"></span>
                    </a>
                </li>
                <li>
                    <a href="portfolio.html">
                        Portfolio
                        <span class="dot"></span>
                        <span class="corner"></span>
                    </a>
                </li>
                <li>
                    <a href="about.html">
                        About
                        <span class="dot"></span>
                        <span class="corner"></span>
                    </a>
                </li>
                
                <li>
                    <a class="" href="service.html">
                        services
                        <span class="dot"></span>
                        <span class="corner"></span>
                    </a>
                </li>
                <li>
                    <a href="blog.html">
                        Blog
                        <span class="dot"></span>
                        <span class="corner"></span>
                    </a>
                </li>
                <li>
                    <a href="contact.html">
                        contacts
                        <span class="dot"></span>
                        <span class="corner"></span>
                    </a>
                </li>
            </ul>
            <em id="showHideMenu" class="show-hide-menu fa fa-bars" href="#"></em>
        </nav>
    <script>
        jQuery(function($){
        $('.main-navi a').filter(function(){
           return $(this).attr('href').toLowerCase() === window.location.pathname.toLowerCase();
        }).addClass('active');
    });
    </script>