如何使用jquery ui 1.8.17创建J-Query ui对话框,模态 [英] How to make J-Query ui dialog, modal using jquery ui 1.8.17

查看:97
本文介绍了如何使用jquery ui 1.8.17创建J-Query ui对话框,模态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码如下:



My code is as follows :

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="Scripts/jquery-1.7.1.js"></script>
    <script type="text/javascript" src="Scripts/jquery-ui-1.8.17.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('<div id="dialogDiv">' + 'This is a dialog.' + '</div>').appendTo('body');
            $('#dialogDiv').dialog({
                resizable: false,
                height: 140,
                modal: true,
                autoOpen: false,
            });
            $('#btnLoad').click(function () {
                $('#dialogDiv').dialog('open');
                return false;
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Button ID="btnLoad" Text="Load" runat="server" />
        </div>
    </form>
</body>
</html>





我希望我的对话框是模态的,这样我就无法点击再次加载按钮,直到我的对话框关闭。但是使用上面的代码,我仍然可以点击加载按钮。



我正在使用JQuery ui 1.8.17。谁能告诉我哪里出错了?即使我的内容只是一个句子,也会出现滚动条。如何只隐藏水平滚动条?



I want my dialog to be modal so that I can not click on "Load" button again till my dialog is closed. But with my above code i can still click on "Load" button.

I am using JQuery ui 1.8.17. Can anyone please tell me where I am going wrong? Also there are scroll bars appearing even though my content is just a sentence. how do I hide only horizontal scroll bar?

推荐答案

(文档).ready(function(){
(document).ready(function () {


('< span class =code-keyword>< div id = dialogDiv > '+'这是一个对话框。'+'< / div > ')。appendTo('body');
('<div id="dialogDiv">' + 'This is a dialog.' + '</div>').appendTo('body');


('#dialogDiv')。dialog({
resizable:false,
height:140,
modal:true,
autoOpen:false,
});
('#dialogDiv').dialog({ resizable: false, height: 140, modal: true, autoOpen: false, });


这篇关于如何使用jquery ui 1.8.17创建J-Query ui对话框,模态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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