効果を繰り返さずにWordPressループ内でjqueryを使用するにはどうすればよいですか
<div class="post">
<?php if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<a class="post_image" href="<?php the_permalink(); ?>" >
<img class="post_image_home" src='<?php $thumb = get_post_custom_values('post_thumb'); echo $thumb[0]?>' alt="postimg" />
</a><!--post_image-->
<?php endwhile; endif; ?></div><!--post-->
jquery:
$j=jQuery.noConflict();
$j('document').ready(function() {
$j('.post').hover(function() {
$j('.post_image').stop().animate({"margin-bottom":"10px",},"fast");
},function(){
$j('.post_image').stop().animate({"margin-bottom":"0px",},"fast");
}); });