Help with jQuery issue
<p>I have a simple page with a list of items. I am allowing users to vote on these items, but I only want to allow the user to vote once per. item. </p>

<p>I made a jQuery script that adds a class to the items the user has voted on:</p>

<pre><code>if(!$(this).find(".item span").hasClass("voted")) {
  $(".item").hover(function() {
    $(this).find(".ratingbar").hide();
    $(this).find(".votebar").show();
  }, function() {
    $(this).find(".votebar").hide();
    $(this).find(".ratingbar").show();
  });
};
</code></pre>

<p>This is the script that prevents the user from voting again on the same item.</p>

<pre><code>$(".votebutton").click(function() {
  $("div#"+offerid).find(".item").addClass("voted");
});
</code></pre>

<p>This isn't working. When hovering an item, the hover function still runs even though the second script successfully added the class "voted" to the html. </p>

<p>Why can this be?</p>
