jQuery resizable() does not drag the panel-footer

Asked

Viewed 88 times

3

When I apply the resizable on the panel and drag it down, the footer does not come with the panel.

Some way to solve this problem?

The code is as follows::

    <div class="panel panel-default" id="resizable">
  <div class="panel-body">A Basic Panel</div>
  <div class="panel-footer">Panel Footer</div>
</div>

<script>
    $( "#resizable" ).resizable({
  handles: "s"
});
</script>

Example: jsfiddle

  • I had the same problem and did not find a simple solution to solve this, I even added in your question an example of this, check and see if this is the same problem :)

  • exactly, that’s the problem thanks!

  • @Spike, see if this example suits you if I prepare the answer... http://jsfiddle.net/SamirChaves/unnqmnd8/6/

  • yes fits perfectly thank you

1 answer

2


What I did was add to your class panel one min-height, so that there would be a decrease that would cause the objects to collide, and a overflow: hidden so that what was inside the panels did not overflow.

.panel{
  min-height: 100px;
  overflow: hidden;
}

Already in the footer what made the difference was position: absolute and the bottom: 0, this way it will be fixed, regardless of the size of the .panel.

.panel-footer{
  position: absolute;
  bottom: 0;
  width: 100%;
}

Obs.: I used the same handles: "s" of the question, so the user can only resize vertically and at the bottom. If you don’t want this, you want a full resize, simply remove the handles and add a min-height/width and a max-height/width at the .panel according to what you want, so that, as @Highlander said, the user does not play around with the layout.

Jsfiddle

  • 1

    When I had this problem I hadn’t found a good solution that only took css, top msm, it wouldn’t be interesting to include a min-height/width for the user not to mess with the layout ?

  • @Highlander, I added a handles: "s", within the .resizable() so that it is only possible to resize at the bottom, according to the code of the question. I think I will add this to the answer rsrs.

  • Not that it’s a problem because it’s a user action, but Handles: "s" allows you to resize upwards by covering the text.

  • So it’s free for the author, it customizes the min-height according to what he wants, I thought I’d create a script for the min be the size of the content, but do not know if it would be so good...

  • perfect thank you!

  • You’re welcome @Espiga...

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.