Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to resize a div, within a parent-div, with parentdiv also resizing?
    primarykey
    data
    text
    <p>I'm fairly new to jQuery, but I like it a lot! Thumbs up to the developers! :)</p> <p>My question is about the resizable function. The situation is as follows:</p> <p>I have a div (parent-div), and within I have 5 other divs (directly next to each other, let's call them div-a through div-e). The parent-div represents a timespan (the longer it is, the more time it represents), and the five childrendiv's represent the five stages within that timespan.</p> <p>Now, I want to be able to resize (let's say) child-div-c (the fase it represents takes more time). The div's D and E must shift to the left while i resize C, because their fases are just happening later, not shorter or longer. The parent-div must resize as well when i'm resizing C, because the total timespan will be longer.</p> <p>I hope this is clear. The questions are:</p> <p>How to move divs next to the resized div? How to resize the parent div?</p> <p>I am aware of the $(".selector).resizable ({}) event, and I got that working. But when I have 2 div's next to eachother, and I'm resizing one of them, it's not moving allong.</p> <p>Thanks in advance!</p> <p>EDIT: Despite this question was downvoted, I have the answer found and made a JSfiddle. See my comment on the accepted answer.</p> <p>The answer to my second question was this:</p> <pre><code>$(".selector").resizable( { resize: function(event, ui) { var widthTotal = 0; $(".travelcontainer &gt; .travelfase").each(function(index, element) { widthTotal = $(this).innerWidth() + widthTotal; }); }); </code></pre> <p>Hope this will help someone else as well :)</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