Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.     $(document).ready(function() {
  3.  
  4.         var getURL = window.location.pathname; /* Gets the URL */
  5.         var hyphened = getURL.replace(/\s/g, '-'); /* Removes spaces and adds hypens to URL if they exist */
  6.         var finalstr = hyphened.substring(hyphened.lastIndexOf('/') + 1); /* Grabs the final string after the last '/' */
  7.         var lowercase = finalstr.toLowerCase(); /* Converts to lowercase letters */
  8.  
  9.         if(lowercase != '')
  10.         {
  11.             $('$projectname$').addClass(lowercase); /* Adds the SEO URL as a class to div#Dx1Base */
  12.         }
  13.         else {
  14.             $('$projectname$').addClass('home-page'); /* Adds home-page as a class to the div#Dx1Base */
  15.         }
  16.  
  17.     });
  18. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement