Wordpress Loop target individual item hover -


have got stuck on little problem, managed wordpress looping correct stuff.. , works fine. problem have got when try target individual item on hover. ive got jquery script working targets them all.. know ive got to change loop not sure im surpose do.. heres code anyway. great if guys help.. thanks

wordpres loop

 <?php $i = 0 ?>         <?php query_posts('showposts=3'); ?>         <?php if(have_posts()) : while (have_posts()) : the_post(); ?>         <?php if( $i == 3 ) : ?>         <div class="row">             <?php endif; ?>                 <div class="col-lg-4 col-md-4">                     <a href="<?php the_permalink(); ?>">                         <div class="miniwork">                             <?php                                  if ( has_post_thumbnail() ) {                                 the_post_thumbnail();                                 }                              ?>                             <figcaption><?php the_title(); ?></figcaption>                         </div>                     </a>                 </div>                  <?php $i++ ?>                  <?php endwhile; ?>             <?php endif; ?>          </div>  

jquery hover

 jquery(".miniwork" ).hover(   function() {     jquery('.miniwork figcaption').addclass('animated tada');     jquery('.miniwork figcaption').css('visibility', 'visible');     var filterval = 'blur(8px)';     jquery('.miniwork img')       .css('filter',filterval)       .css('webkitfilter',filterval)       .css('mozfilter',filterval)       .css('ofilter',filterval)       .css('msfilter',filterval);     jquery('.miniwork figcaption').css('opacity', '0.95')   }, function() {     jquery('.miniwork figcaption').removeclass('animated tada');     jquery('.miniwork figcaption').css('visibility', 'hidden');     jquery('.miniwork figcaption').css('visibility', 'hidden');     var filterval = 'blur(0px)';     jquery('.miniwork img')       .css('filter',filterval)       .css('webkitfilter',filterval)       .css('mozfilter',filterval)       .css('ofilter',filterval)       .css('msfilter',filterval);       jquery('.miniwork figcaption').css('opacity', '0')   } ); 

you targeting class "miniwork" being assigned every div .. can assign #id each div --

<div class="miniwork" id="<?php echo get_the_id(); ?>">     <?php          if ( has_post_thumbnail() ) {         the_post_thumbnail();         }      ?>     <figcaption><?php the_title(); ?></figcaption> </div> 

now in jquery taget 'miniwork#id-of-the-post'


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -