简体   繁体   English

如何将自动滚动添加到“可调整大小” <div> ?

[英]How to add auto-scroll to 'resizable' <div>?

I am using JQuery 'resizable' in a div. 我在div中使用JQuery'resizable'。 When I add column multiple columns to a row, it should horizontally and once out of screen space, enable the Horizontal Scroll bar.. Same with vertical scroll bar.. I need to fix a height and if it crosses the the height during multiple row addition, it should enable vertical scroll. 当我将一列多列添加到一行中时,它应该水平且超出屏幕空间,然后启用水平滚动条。与垂直滚动条相同。我需要固定高度,如果它在多行中超过了高度另外,它应该启用垂直滚动。 I use the below code.. 我使用以下代码。

 <div id="resizable" class="ui-widget-content">
  <h3 class="ui-widget-header">Overview</h3>
         <table id="table1" class="table1">       

                <tr class="even">
                    <td>
                        <div id="rowColumn" class="rowColumn">         
                            <select id="ddlNumber" name="ddlNumber" class="ddlNumber" style="height:20px; Width:160px;" >                        
                              <option value="1">1</option>
                              <option value="2">2</option>                                  
                            </select>
                            <select id="ddlMatch" name="ddlMatch" class="ddlMatch" style="height:20px; Width:120px;" > </select>                            

                            <input type="text" id="textMatchMe" name="textMatchMe" class="textMatchMe" style="height:20px; width:140px"/>
                            <input type="text" id="textMatchMeNumber" name="textMatchMeNumber" class="textMatchMeNumber" style="height:20px; width:140px" "/>
                             <input type="button" id="btnAddColumn" name="btnAddColumn" class="addcolumn add" value="OR" style="height:auto;"/>
                        </div>
                    </td>
                </tr>               
        </table>

        <div>

            <input type="button" id="btnAddRow" name="btnAddRow" class="btnAddRow" value="AND" style="height:auto; "/>                
        </div>               
</div>

Thanks in advance.. 提前致谢..

-DK -DK

Set a max-width and max-height. 设置最大宽度和最大高度。

table {
  max-width:600px;
  max-height:600px;
  overflow-y:scroll;
  overflow-x:scroll;
}

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

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