title: jQuery: Check if hash contains
body: <p>I'm looking to try and check if the hash in the url contains a certain value before proceeding, I have a function that works like so:<br></p>
  
  <pre><code>$(window).load(function () {
      var hash = window.location.hash,
          number = $(hash).index(),
          width = 403,
          final = width * number;
          setTimeout(function () {
          $('.news-inner-wrap').animate({
              'marginLeft': "-=" + final + "px"
          });
          }, 1000);
  });
  </code></pre>
  
  <p>So if the hash is <code>www.website.com/#news-item-03</code> it will slide the user horizontally along to the 3rd news story, this works great!. I only want this function to fire though if the hash contains <code>news-item</code> obviously the number after each will change, but if the hash begins with <code>news-item</code> then I want the function above to be fired, I'm not even sure it this is at all possible, any suggestions would be greatly appreciated!</p>