There is a cshtml page, several div elements on it that should be shown as modal windows, jquery code of the standard dialog:

$("#add_edit-form").dialog({ autoOpen: false, resizable: false, modal: true, open:function(){{ $(this).parent().appendTo($("form:first")).css({ "z-index": "101" }); }} }); 

The problem is that when you click on any submit, all divs designed for these dialogues appear and disappear at the bottom of the page (albeit in plain text). This flickering is quite noticeable, maybe someone knows how to get rid of it?

    1 answer 1

     <div id="add_edit-form" style="display:none;">...</div> 

    They do not appear "when you click on any submit", but when the page is reloaded - they immediately hide when the $("#add_edit-form").dialog({...}) code is executed $("#add_edit-form").dialog({...}) . Make them invisible from the beginning, and they won't appear until you call

    $("...").dialog("open"); .

    • Works! Thank!!! A small addition to my dialog code if there is a line: open: function () {{$ (this) .parent (). AppendTo ($ ("form: first")). Css ({"z-index": "101 "}); then it incorrectly fulfills the dialogue. Better this line ($ (this) .parent (). AppendTo ($ ("form: first")). Css ({"z-index": "101"});) move the bracket} of the dialog. - Daria