jQuery - if div height over 'x', show only content within the visible div, add an image and scroll u

Posted by Nicki on Stack Overflow See other posts from Stack Overflow or by Nicki
Published on 2010-04-29T15:22:03Z Indexed on 2010/04/29 15:27 UTC
Read the original article Hit count: 122

Filed under:

Apologies, I'm very new to jQuery. I am trying to apply jQuery to a div which could contain any number of p tags of varying length or none at all. Depending on the assembled p's this div needs to maintain a height of 45px. If the p's contained therein push the div to be higher than 45px then I need to add an anchor image which users can click allowing the div to slide up and reveal the div's contents. I've browsed the plugins but can't find anything to cater for this.

<div class="SummaryExtras">
<h3><span>h3 Title</span></h3>
<div>
  <p class="Extra">text</p>
  <p class="Extra">text</p>
  <p class="Extra">text</p>
  <p class="Extra">text</p>
  <p class="Extra">text</p>
 </div>
 <div class="SummaryExtrasBottom"></div>
</div>

© Stack Overflow or respective owner

Related posts about jQuery