对话框在页面消失前加载

时间:2022-04-20 19:43:56

I'm using JQuery UI dialog that pops up when a user clicks a button (otherwise, it should be hidden). When the page loads, the dialog is actually seen on the page for a few seconds before disappearing (because the dialog is embedded onto the page). Is there anyway to prevent this appearance when loading?

我正在使用当用户单击按钮时弹出的JQuery UI对话框(否则,它应该被隐藏)。当页面加载时,对话框实际上会在页面上显示几秒钟,然后消失(因为对话框嵌入到页面中)。反正加载时是否有防止这种外观?

1 个解决方案

#1


1  

when you set Dialog box html , set this dialog box css

当您设置对话框html时,设置此对话框css

{display:none}

or if you want by jQuery then onpageload apply

或者如果你想通过jQuery,那么onpageload适用

$(document).ready(function(){
$("#dialgboxid").hide();
});

now if you load page then this problem not appear and when you open dialog box by click it appear correctly

现在,如果您加载页面,则不会出现此问题,当您通过单击打开对话框时,它会正确显示

#1


1  

when you set Dialog box html , set this dialog box css

当您设置对话框html时,设置此对话框css

{display:none}

or if you want by jQuery then onpageload apply

或者如果你想通过jQuery,那么onpageload适用

$(document).ready(function(){
$("#dialgboxid").hide();
});

now if you load page then this problem not appear and when you open dialog box by click it appear correctly

现在,如果您加载页面,则不会出现此问题,当您通过单击打开对话框时,它会正确显示