Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
apply function for each component jquery

I have a Wordpress page where I display a bootstrap container > row > col which is replicated for each blog post I have. I added jQuery and customized blog card which on hover displays like shown:

enter image description here

However, it works only on the first card, while on the other cards - jQuery is not used (class animate is not added).

This is my loop-item.php where I have my card template:

<div class="col-lg-4 col-md-6 mb-5">
    <div id="product-card"> 
        <div id="product-front">
            <div class="shadow"></div>
            <img src="<?php the_post_thumbnail(); ?>" />
            <div class="image_overlay"></div>
            <a href="<?php the_permalink(); ?>">
                <div id="view_details">Citeste</div>
            </a>
            <div class="stats">  
                <div class="stats-container">
                    <span class="product_name"><strong><?php the_title(); ?></strong></span> 
                    <div class="product-options">
                        <p> <?php the_content() ?>  </p>
                    </div>
                </div>   
            </div>                         
        </div>
    </div>
</div>

And this is my jQuery file:

    $(document).ready(function(){
    // Lift card and show stats on Mouseover
    $('#product-card').hover(function(){
            $(this).addClass('animate');
            $('div.carouselNext, div.carouselPrev').addClass('visible');            
         }, function(){
            $(this).removeClass('animate');         
            $('div.carouselNext, div.carouselPrev').removeClass('visible');
    }); 
});
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda