views:

23

answers:

0

Hello,

Anybody has a idea how to intergrate "Reddit-style Voting" with "Galleriffic 2"?

links: http://ad1987.blogspot.com/2009/02/reddit-style-voting-with-php-mysql-and.html http://www.twospy.com/galleriffic/

I would like to show in description div buttons with option to rating photo.

I try to do that, but the script doesn't start when is in "caption" div (Code for rating works fine normaly without galleriffic.)

I put in "cation" div code:

<div class='entry'>     
 <span class='votes_count' id='votes_count57'>126 votes</span>
 <span class='vote_buttons' id='vote_buttons57'>           
    <a href='javascript:;' class='vote_up' id='57'>up</a>  
    <a href='javascript:;' class='vote_down' id='57'>down</a>  
 </span> 

 <span id="response" style="width:200px;"></span>  
</div>

and Javascript in footer:

<script type='text/javascript'>

$(function(){

$("a.vote_up").click(function(){

//get the id
 the_id = $(this).attr('id');

 // show the spinner
 $(this).parent().html("<img src='../../../site/public/images/votes/spinner.gif'/>");

 //fadeout the vote-count 
 $("span#votes_count"+the_id).fadeOut("fast");

 //the main ajax request
  $.ajax({
   type: "POST",
   data: "action=vote_up&id="+$(this).attr("id"),
   url: "votes.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();
    $("#response").text('Thanks. Your vote have been saved!!');
   }  
  });
 });

        // the same for vote_down

</script>

The rate button are shown in description, but script does't start and rating not works.

Greatings, Darek