Note that there are some explanatory texts on larger screens.

plurals
  1. POAnimate() divs from a reference point?
    primarykey
    data
    text
    <p>I have 9 divs, in rows of 3. When I click one of them I want the others fadeOut (that's ok, any problem) and then the one I clicked resize anything it will need from left, right, top and bottom, until it cover all the 9 divs space. And I got that for the first div in the first row, because it's in the top-left corner, but with the other ones, they go to the top-left corner and then resize, and I want resize them in the place they were when I clicked. And then center the inside of the div of course.</p> <p>I am trying it with jquery-ui, and I am pretty new with that, so I don't know if it could be very complicated or not. I googled "jquery animate() from reference point", but I didn't get anything.. </p> <p>thanks all!</p> <pre><code> &lt;div id="row1" class="row-fluid"&gt; &lt;p id="p1" class="hero-unit span4 "&gt;P número 1&lt;/p&gt; &lt;p id="p2" class="hero-unit span4 "&gt;P número 2&lt;/p&gt; &lt;p id="p3" class="hero-unit span4 "&gt;P número 3&lt;/p&gt; &lt;/div&gt; &lt;div id="row2" class="row-fluid"&gt; &lt;p id="p4" class="hero-unit span4 "&gt;P número 4&lt;/p&gt; &lt;p id="p5" class="hero-unit span4 "&gt;P número 5&lt;/p&gt; &lt;p id="p6" class="hero-unit span4 "&gt;P número 6&lt;/p&gt; &lt;/div&gt; &lt;div id="row3" class="row-fluid"&gt; &lt;p id="p7" class="hero-unit span4 "&gt;P número 7&lt;/p&gt; &lt;p id="p8" class="hero-unit span4 "&gt;P número 8&lt;/p&gt; &lt;p id="p9" class="hero-unit span4 "&gt;P número 9&lt;/p&gt; &lt;/div&gt; $(document).ready(function() { $("p").click(function() { current = $(this); $("p").not(this).fadeOut(1000, function(){ current.animate({ margin: "0px", height: "420px", width: "940px", }, 1000, function(){ current.removeClass("span4"); }); }); }); }); </code></pre> <p>Thats' all I have, very simple.</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.
    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