Task: there is a block with pictures that are images of different WP posts. Block the content(); hidden in CSS. It is necessary to implement the display of the contents of the corresponding content block when clicking on the corresponding image.
In the last attempt I tried to display the hidden div c content besides the error, I also ran into this error:
Uncaught TypeError: $ is not a function (...)
I beg you, tell me how can this be implemented?
$(".show-more").click(function(){ $(document).find(".more_service:not(:visible)").slideToggle('fast', function() { if ($(document).find(".more_service:not(:visible)").length==0) { $(".show-more").css("display","none"); } } ); }) #more_service { display: none; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <?php while ($gadget->have_posts()) : $gadget->the_post(); ?> <div class="img-hover"> <img class="img-responsive img-rounded show-more" id="client" src="<?php echo get_the_post_thumbnail_url(); ?>" alt="<?php the_title(); ?>"> </div> <div id="more_service"> <?php the_content(); ?> </div>