为什么我的对话框不起作用 [英] Why my Dialog box isn't working

查看:99
本文介绍了为什么我的对话框不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我正在尝试但无法正常工作的代码,根本没有任何内容

This is the code I am trying and not working, nothing comes up at all

<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jquery/jquery-ui.min.js"></script>
<script type="text/javascript">
    function HandleIt()
    {
        var objA = $get('<%= chkBox.ClientID %>');

        if(objA.checked == false)
            $("#dialog").dialog();

            //alert("it works");
    }  
</script>
<div style="width: 800px;">
    <asp:ScriptManager ID="ScriptMan1" runat="server" />
    <div class="dialog">
        <div class="a">
        <asp:Label ID="lbla" runat="server" CssClass="text" />
    </div>
    <div class="b">
        <asp:Label ID="lblb" runat="server" CssClass="text" />
    </div>
</div>

我给出的代码在对话框时有效,

Code I given down works when dialog when it is like this,

<div class="dialog"> Hahahahaha </div>

我想将它用作消息框,但它没有用完。

I want to use it as message box but its not working out.

推荐答案

因为你的选择器是带有id的catches标签,你需要按类命中。尝试将您的选择器更改为:$(。dialog)。dialog();

Because your selector is catches tag with id's and you need hit by class. Try to change your selector to this one: $(".dialog").dialog();

这篇关于为什么我的对话框不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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