Hello,
I have a button that counts the number of clicks. when it is clicked, number goes up, and the image disappears. but I want it to show the image again when it is clicked, but can't be clicked after the first time is clicked. I already have this script but I tried adding some codes in but doesn't work. I was wondering if someone can help me out?
Thank you
$(function(){
$("a.product_ratings").click(function(){
//get the id
the_id = $(this).attr('id');
thumbsUp = $(this).attr('id');
// show the spinner
$(this).parent().html("<img src='images/spinner.gif'/>");
//show the thumbsup
$(this).parent().html("<img src='images/yes-enb.JPG'/>");
//fadeout the vote-count
$("span#votes_count"+the_id).fadeOut("fast");
//the main ajax request
$.ajax({
type: "POST",
data: "action=product_ratings&id="+$(this).attr("id"),
url: "votes2.php",
success: function(msg)
{
$("span#votes_count"+the_id).html(msg);
//fadein the vote count
$("span#votes_count"+the_id).fadeIn();
//remove the spinner
$("span#vote_buttons"+the_id).remove();
//fadein the thumbsup
$("span#votes_count"+thumbsUp).fadeIn();
}
});
});