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="width:945px;height:85%; margin: auto; display: none;">
        <div id="tt" class="easyui-tabs"  fit="true" fitColumns="true" border="true" style="width: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="width: 40%;">
                      。。。。     
                    <tr>
                        <th>地址:</th>
                        <td><input id="address" type="text" name="address" style="width:310px;"
                            class="easyui-textbox" data-options="required:true"></input></td>
                    </tr>
                    <tr>
                        <th>邮箱:</th>
                        <td><input id="email" type="text" name="email" style="width: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');
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM