简体   繁体   English

jQuery的UI也调整子div的大小

[英]jquery-ui resize child divs also

I am creating a website I have divs which are resizable using jquery. 我正在创建一个网站,我有使用jQuery可调整大小的div。 When I resize them only the width of the child divs get resized. 当我调整它们的大小时,只会调整子div的宽度。 You can see the site and its code here . 您可以在此处查看该站点及其代码。 How can the height of the child divs get resized too? 子div的高度也如何调整大小?

Edit 编辑

Ok I solved it by adding this code: 好的,我通过添加以下代码解决了它:

  $(".window").resize(function() 
  {
     $(this).children('.inner').css(
     {
        height: $(this).height()-2
     });

     $(this).children().children('.content').css(
     {
        height: $(this).height()-$(this).children().children('.top').height()*2
     });
  });

you need to change the child div height to 100% 您需要将子div高度更改为100%

in your case the div with class = "inner" need to have css property 在您的情况下,类=“ inner”的div需要具有css属性

div.inner
{
   height = 100%
}

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM