I have this code on header.php
<!-- img Style -->
<link href="<?php bloginfo('template_directory'); ?>/picanim files/picanim.css" rel="stylesheet" type="text/css" />
<script src="<?php bloginfo('template_directory'); ?>/picanim files/jquery-1.7.2.min.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/picanim files/jquery.picanim.min.js"></script>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($){
$('#test1 img').picanim({initEf:'grayscale',hoverEf:'fadeIn'});
});
</script>
<!-- img Style -->
and I have this jquery in an index.php
:
<div class="left-slide">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="boxgrid caption" >
<div id="test1">
<img src="<?php echo get_post_meta ($post->ID, 'img',true); ?>" width="200" height="150" alt=" "/>
</div>
<div class="cover boxcaption">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link to ','dnld'); ?><?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="clear10"></div>
<h4> <a href="<?php the_permalink() ?>">Details</a> </h4>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
The "test1"
is id that I define in jQuery in header.php
This jQuery, grayscale my picture and when the mouse hover on picture, color it!
More Details about this code here : http://1.s3.envato.com/files/32652661/index.html
My problem is that every picture on my page easily work with this jQuery but when I call it in php loop, jquery doesn't work!!