2016-11-20 67 views
0

我有塊圖像,這是不同的職位WP的縮略圖。阻止「內容();」隱藏在CSS中。點擊corespond img後,我需要顯示內容。wordpress顯示內容塊與ajax

在最後一次嘗試我試圖顯示與內容塊,我已經收到不匹配與contetn股利和這個錯誤隱藏的div:

遺漏的類型錯誤:$不是一個函數(...)

$(".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> 
 

 
<?php endwhile; 
 
wp_reset_query(); ?>

請告訴我,我怎麼能正確做這個任務?

回答