Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing JQuery to animate size of div
    primarykey
    data
    text
    <p>I am an amateur in Jquery but am so close to getting what I am looking for. I am trying to have a containing div animate to a larger height when an object is clicked. I am using the following code:</p> <pre><code>&lt;div id="sliderone"&gt; &lt;div id="nav"&gt; &lt;div id="navone" style="text-align: center;"&gt;This is a clickable title&lt;/div&gt; &lt;/div&gt; &lt;div id="ourteam"&gt; &lt;div id="title"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $('#navone').click(function(){ $('#title').html("&lt;img src='http://placehold.it/350x550' alt='' /&gt;"); $('.post-8 .content-container').animate({height: '950'}); }); &lt;/script&gt; #navone { padding:20px 20px; cursor:pointer; } #title { width:350px; margin:0 auto; } #sliderone { height:50px; background-color:#777777; position: absolute; margin-top: -500px; left: 50%; margin-left: -175px; } </code></pre> <p><code>#sliderone</code> has to be absolutely positioned and so when I try to animate <code>.post-8 .content-container</code> it makes the top longer in comparison instead of making the bottom longer to contain the new content. Can I either animate the negative margin smaller or animate the bottom of the <code>.post-8 .content-container</code>?</p> <p>Thank you for any help. I have worked hard on this and just can't quite figure out this last problem. </p> <p>Here is the actual page to see. </p> <p><a href="http://s416809079.onlinehome.us/wp-login" rel="nofollow">http://s416809079.onlinehome.us/wp-login</a> login:stackoverflow password:stackoverflow</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload