jQuery - Dialog auto-resize on dynamic content and maintain center position

前端 未结 6 600
梦谈多话
梦谈多话 2020-12-30 13:51

I have a jQuery Dialog box and Am loading the content using Ajax.

The Dialog is initially in the center of the page. The problem , here is , Since its a dynamic con

6条回答
  •  离开以前
    2020-12-30 14:15

    I was looking for a simple solution and realized that my graph wasn't finished "drawing" before opening the dialog so I enclosed the .dialog('open') command in a setTimeout function.

    setTimeout(function () {
        $('#pie-Admin-Summary-dialog').dialog('open');
    }, 500);
    

    You can play with the timing. I opted for 1/2 second.

提交回复
热议问题