zoukankan      html  css  js  c++  java
  • Easyui dialog Y轴滚动条定位

    使用Easyui dialog进行数据新增的时候,如果Y轴方向有滚动条,当关闭之前的时候,将滚动条拉到最下方,再次打开的时候,滚动条还是定位在最下方。

    需求: 每次打开的时候dialog Y轴滚动条定位在上方。

    如图:

    HTML文件:

        <div id="mydialog" title="新建xxxx"
            class="easyui-dialog" data-options="modal:true,closed:true,draggable:false"
            style="945px;height:85%; margin: auto; display: none;">
            <div id="tt" class="easyui-tabs"  fit="true" fitColumns="true" border="true" style="auto;height:auto;">
            <div title="基本信息" closable="false" border="true" id="tt_tabs_a">    
            <form id="xxxx" action="" method="post">
                <input type="hidden" name="id" id="id" value="" />
                <table class="formTable" style=" 40%;">
                          。。。。     
                        <tr>
                            <th>地址:</th>
                            <td><input id="address" type="text" name="address" style="310px;"
                                class="easyui-textbox" data-options="required:true"></input></td>
                        </tr>
                        <tr>
                            <th>邮箱:</th>
                            <td><input id="email" type="text" name="email" style="310px;"
                                class="easyui-textbox" data-options="required:false"></input></td>
                        </tr>
                        
                       。。。
                </table>
            </form>
            </div>
            </div>
        </div>

    JS文件:

        var currentTab = $('#tt').tabs('getSelected');
        $("#tt").tabs("select",0);
        RefreshTab(currentTab);
        $("#tt_tabs_a").scrollTop(0);
    //刷新当前标签Tabs
    function RefreshTab(currentTab) {
        var url = $(currentTab.panel('options')).attr('href');
        $('#tt').tabs('update', {
            tab: currentTab,
            options: {
                href: url
            }
        });
         currentTab.panel('refresh');
    }
  • 相关阅读:
    BZOJ1477 青蛙的约会
    Code Style
    线段树合并
    动态开点
    主席树
    启发式合并
    树的重心
    树的直径
    扩展欧几里得
    裴蜀定理
  • 原文地址:https://www.cnblogs.com/mr-wuxiansheng/p/7772623.html
Copyright © 2011-2022 走看看