Style Jquery dialog content div

后端 未结 2 532
旧时难觅i
旧时难觅i 2021-01-24 01:24

I have this situation:

var div = document.createElement(\'div\');
div.id=\"content\";

$(div).dialog(\'open\');

The content of the div opens i

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-24 02:09

    Try a little more advanced but making dialog a little better:)

        $("#myDialog").dialog(
        {                                
            modal: true,
            show: "fade",
            hide: "fade",
            draggable: false,
            resizable: false,
            closeOnEscape: false,
            width: 400,
            position: "top",
            buttons: 
            {
                Close:  function()
                        { 
                            $(this).dialog('close');                                
                        }
            },
            open:   function()
                    {        
                        /* styling dialog */
                        $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").remove();             
                        $(this).parents(".ui-dialog").css("padding", 5);  
                        $(this).parents(".ui-dialog").css("border", 0);
                        $(this).parents(".ui-dialog:first").find(".ui-dialog-content").css("padding", 0);
    
                        $(this).css("-webkit-box-shadow", "0px 0px 10px rgba(0, 0, 0, 0.8)");
                        $(this).parents(".ui-dialog").css("-webkit-box-shadow", "0px 0px 10px rgba(0, 0, 0, 0.8)");
                        $(this).parents(".ui-dialog").css("-moz-box-shadow", "0px 0px 10px rgba(0, 0, 0, 0.8)");                        
        });   
    

提交回复
热议问题