核桃说笔记
点击展开看更多内容的效果:
<div class="ht_div14">
<div class="ht_div15">
<p class="ht_p19">
<img src="{$answerx['author_avartar']}" class="ht_img17" />
<img src="{SITE_URL}static/pc/img/sy14.png" class="ht_img18" style="display:none" />
</p>
<div class="ht_div16">
<div class="ht_div17">
<p class="ht_p20">{$answerx['author']}</p>
<!--<p class="ht_p21"></p>
<p class="ht_p22">{$answerx['author_groupname']}</p>-->
</div>
<p class="ht_p23">
<span>{$answerx['time']}</span>
</p>
</div>
</div>
<div class="ht_p25">
<div class="ht_p25_yincang">
部分内容。。。。。。
</div>
<p class="ht_p46">
<span>展开全部</span>
<img src="{SITE_URL}static/pc/img/sy07.png" />
</p>
</div>
</div>
<script type="text/javascript"> /*点击展开全部效果*/ $(function() { $(".ht_div14").each(function() { var hh = $(this).find(".ht_p25").height(); var zk = $(this).find(".ht_p46").html(); if(hh > 400&&zk) { $(this).find(".ht_p25").css("max-height", "400px"); $(this).find(".ht_p25 .ht_p46").show(); } }) }) $(".ht_p46").on("click", function() { $(this).hide(); $(this).parents(".ht_p25").css("max-height", "none"); }) </script>

更多精彩