0

I do not know why but my Jquery dialog is not appearing.

html code

 <div id="dialog" title="Uploaded Image">
     <p> sample jquery dialog  box </p>
 </div>

Script Code

                <script>
                $(function(){
                    $("#dialog").dialog({
                        model:true,
                        show: {
                            effect: "blind",
                            duration: 1000
                        },
                        hide: {
                            effect: "blind",
                            duration: 1000
                        }
                        buttons:{
                            "Uploads": function(){
                                $(this).dialog("close");
                            }
                            "Cancel" : function(){
                                $(this).dialog("close");
                            }
                        } 
                    });
                });
            </script>

I am using chrome

4

2 回答 2

2

您在","之后hide和内部缺少逗号分隔符button

尝试这个

$(function(){
     $("#dialog").dialog({
      modal:true,
      show: {
              effect: "blind",
              duration: 1000
            },
      hide: {
              effect: "blind",
              duration: 1000
             },
      buttons:{
               "Uploads": function(){
                             $(this).dialog("close");
                            },
                "Cancel" : function(){
                              $(this).dialog("close");
                            }
                        } 
                    });
                });

JS 小提琴演示

于 2013-05-02T00:58:50.283 回答
2

您的脚本缺少一些,并且}

$(function(){
    $("#dialog").dialog({
        modal:true,
        show: {
            effect: "blind",
            duration: 1000
        },
        hide: {
            effect: "blind",
            duration: 1000
        }, //Missing ,
        buttons:{
        "Uploads": function(){
            $(this).dialog("close");
        }, //Missing ,
        "Cancel" : function(){
            $(this).dialog("close");
        }
    }
  });
});

演示:小提琴

于 2013-05-02T00:59:02.060 回答