Using jQuery To Add Class Based On URL
<p>I'm using jQuery and I'm trying to add a class to a menu item based on URL. I tried this(found in other topics), but cannot get it to work properly. It adds the class to every menu item after the current page url.</p>

<p>Here is my code:</p>

<pre><code>&lt;script type='text/javascript'&gt;
  $(document).ready(function(){
    $(function() {
        switch (window.location.pathname) {
            case '/p/about.html':
                    $('.nav-about').addClass('current')
            case '/search/blog':
                    $('.nav-blog').addClass('current')
            case '/p/design.html':
                    $('.nav-design').addClass('current')
            case '/p/photography.html':
                $('.nav-photography').addClass('current')
            case '/p/hosting.html':
                $('.nav-hosting').addClass('current')
        }
      });
  });
&lt;/script&gt;
</code></pre>

<p>Any help on correcting this?</p>

<p>Thanks.</p>

<p>EDIT: for those asking, I am using Blogger. Instead of using the default "Link-List", I created my own responsive menu. There is only one template here, so it's not like I can add a class to each HTML page. It's gonna have to be done with jQuery, because Blogger doesn't add specific classes to specific pages. So I need to grab the URL to apply the appropriate class to the appropriate menu item.</p>
