Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make jQuery animate upwards
    primarykey
    data
    text
    <p>I've got some jquery running fairly well, howeever when I hover over the element in question, the bottom expands downward which is not unexpected but is not the desired effect. I'd like the bottom of the element to remain stationary with the top of the element expanding upwards.</p> <p>If you'd like to see what I currently have, you may navigate to <code>http://demo.ivannovak.com/mobia/</code></p> <p>Any help would be greatly appreciated.</p> <p>Here is my code:</p> <p><code>HTML</code></p> <pre><code> &lt;div class="button"&gt; &lt;h3&gt;Product Quality&lt;/h3&gt; &lt;div&gt;Duis tristique ultricies velit sit amet adipiscing.&lt;/div&gt; &lt;img src="&lt;?php bloginfo('template_url'); ?&gt;/assets/img/INgravatar_subernova.png" alt="placeholderImage" height="70" /&gt; &lt;p&gt;&lt;a href="#"&gt;Learn More &amp;gt;&lt;/a&gt;&lt;/p&gt; &lt;div class="bottom"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p><code>CSS</code></p> <pre><code> div#buttons {} div#buttons .button { background: url(assets/img/bg_blue_top.jpg) #206094 no-repeat top left; padding: 5px 10px 0; width: 209px; float: left; margin-right: 5px; position: relative; height: 50px; } div#buttons .button h3 { font-weight: normal; color: #fff; text-transform: uppercase; } div#buttons .button:hover div, div#buttons .button:hover img { /* display: block; */ } div#buttons .button div { width: 120px; padding-right: 20px; float: left; color: #bbb; display: none; } div#buttons .button img { float: right; display: none; } div#buttons .button p { position: absolute; bottom: 10px; left: 10px; z-index: 9; font-weight: bold; text-transform: uppercase; } div#buttons .button p a { color: #7bc143; text-decoration: none; } div#buttons .button p a:hover { text-decoration: underline; } div#buttons .button .bottom { background: url(assets/img/bg_blue_bottom.jpg) no-repeat bottom left; height:26px; position: absolute; display: block; width: 229px; right: 0px; padding:0; bottom: 0; } </code></pre> <p><code>jQuery</code></p> <pre><code> $(document).ready(function() { $('.button').mouseenter(function() { $(this).closest('div').animate({ height: "150px", }, 400, "swing"); }); $('.button').mouseleave(function() { $(this).closest('div').animate({ height: "50px", }, 400, "swing"); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    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