I am trying to create a wordpress category page that lists my products main thumbnail and also a second thumbnail when the mouse is over the first one.
I was able to make it work on the first image: http://www.anapiazza.com.br/category/anel/
But it is not replicating to the other products images.
I am using a plugin called Multiple Post Thumbnails to allow multiple thumbnails for each post.
This is the piece of Jquery I am using:
<script>
$(document).ready(function(){
$("#productcell").mouseenter(function(){
$("#thumbnail_over").fadeIn("slow");
});
});
$(document).ready(function(){
$("#productcell").mouseleave(function(){
$("#thumbnail_over").fadeOut("slow");
});
});
</script>
And this is how it looks on the body of my PHP page:
<div id="productcell">
<!-- Image Swap Mouse Over -->
<a href="<?php the_permalink() ?>">
<div id="thumbnail_normal"><?php the_post_thumbnail(); ?></div>
<div id="thumbnail_over" style="display: none">
<?php if (class_exists('MultiPostThumbnails')) :
MultiPostThumbnails::the_post_thumbnail(
get_post_type(),
'secondary-image'
);
endif; ?>
</div>
</a>
</div>
This is my CSS for this portion of the page:
#productcell {float: left; position: relative; width:30%; height: 40%; margin: 1%}
#thumbnail_normal {position: absolute; width: 100%; height: 100%; }
#thumbnail_normal img {max-width: 100%; height: auto}
#thumbnail_over {position: absolute; z-index: 10}
#thumbnail_over img {max-width: 100%; height: auto}
I know there is a lot going on... Maybe I am a little ambicious with what I am trying to accomplish... Anyway - anyone has an idea of what can be going wrong?