5

jquery ui 模态表单右上角的关闭按钮出现显示问题。我有一个例子:http: //jqueryui.com/dialog/#modal-form

所以我做了:http: //jsbin.com/atenac/3/edit

如果单击创建新用户,您应该会看到关闭图标未正确显示。

我用 chrome(latest) 和 IE9 进行了测试。它从实际容器的右下角显示。

主题有问题,还是我遗漏了什么?如果您更改为基本 cdn,它可以工作,但对于任何其他 css,它都无法正常工作。

代码:

<head>
    <!-- base cdn: http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/base/jquery-ui.css-->
    <link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.0/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>

</head>
<body>
    <div id="dialog-form" title="Create new user">
        <p class="validateTips">
            All form fields are required.</p>
        <form>
        <fieldset>
            <label for="name">
                Name</label>
            <input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" />
            <label for="email">
                Email</label>
            <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" />
            <label for="password">
                Password</label>
            <input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
        </fieldset>
        </form>
    </div>
    <button id="create-user">
        Create new user</button>
</body>
<script>
    $(function () {
        $("#dialog-form").dialog({
            autoOpen: false,
            height: 300,
            width: 350,
            modal: true,
            buttons: {
                "Create an account": function () {
                    allFields.removeClass("ui-state-error");
                    $(this).dialog("close");

                },
                Cancel: function () {
                    $(this).dialog("close");
                }
            },
            close: function () {
                allFields.val("").removeClass("ui-state-error");
            }
        });

        $("#create-user")
                  .button()
                  .click(function () {
                      $("#dialog-form").dialog("open");
                  });
    });
</script>
4

1 回答 1

8

您似乎使用了不正确的样式表(版本 1.9.0)。链接到 CSS 的 1.10.0 版本似乎已修复它:http: //jsbin.com/atenac/8/edit

正确的 CSS 链接是: http ://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/themes/smoothness/jquery-ui.css

于 2013-01-31T00:41:57.653 回答