heightStyle:“fill”是不是手风琴在Jquery工作 [英] heightStyle: "fill" is not working for accordion in Jquery

查看:172
本文介绍了heightStyle:“fill”是不是手风琴在Jquery工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- 随着容器尺寸的变化,我可以自定义

在#backlogEpic中定义的宽度,即526px,但高度不是

自定义。为了填充由它的容器分配的垂直空间,i
已经将heightStyle选项设置为fill,但仍然不能正常工作

out。它的默认高度使用'auto'。我如何自定义

我的高度。如果您看到图像,展开面板会出现容器。

- With the change in dimension of container I'm able to customize
width that is defined in #backlogEpic i.e 526px but height is not
customizing . To fill the vertical space allocated by its container,i have set the heightStyle option to "fill" but still its not working
out. Its taking is default height using 'auto'. How can i customize
my height.If you see in image ,expanded panel is going out of container.

     html:-  
        <div id="backlogEpic" class="ui-widget-content">
        <div id="backlogAccordion">  
        <--- accordian code---->   
        </div> 
        </div>

    css :-  
      #backlogEpic{  
      padding: 10px;    height: 200px;    width: 526px;    right: 25px;    }  

   javascript:-  


    $(function() {

      $( "#backlogEpic" ).resizable({
         minHeight:140,
          minWidth: 150,
          resize: function() {
              $( "#backlogAccordion" ).accordion( "refresh" );
          }
      });
      $( "#backlogAccordion" ).accordion({
          heightStyle: "fill"
      });    });


推荐答案

我的网站使用jQuery 1.9.1和jQueryUI 1.10.2。我所有的努力都在父div,但没有从文档或讨论没有工作。昨天我发现SO主题 jquery 1.9手风琴高度问题,其中Mottie建议修改

I have been fighting the same problem as you. My site is using jQuery 1.9.1 and jQueryUI 1.10.2. All my efforts had been on the parent div, but nothing from the documentation or discussions had worked. Yesterday I discovered the SO topic jquery 1.9 accordion height issue in which Mottie suggests modifying the CSS for each accordion panel instead of the parent:

#accordion .ui-accordion-content {    
    max-height: 400px;
    overflow-y: auto;
}



在我从昨天开始的有限测试中,这解决了我的问题手风琴溢出其容器。

In the limited testing I have done since yesterday, this has solved my problem of the accordion overflowing its container.

这篇关于heightStyle:“fill”是不是手风琴在Jquery工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆