jQuery UI - Error: cannot call methods on dialog prior to initialization; attempted to call method 'open' [duplicate]

廉价感情. 提交于 2019-12-03 02:55:38

You have to initialize the dialog before being able to open it:

$(function() {
    $("#dialog").dialog({
        autoOpen: false
    });

    $("#player").on('click', 'img', function() {
    ...

Here's a complete example: https://jqueryui.com/dialog/#animated

Set it up first:

$("#dialog").dialog();

Try it yourself: http://jsfiddle.net/x5w8r/

You are calling the open method before the Dialog Widget has been initialized for more information go here: https://api.jqueryui.com/dialog/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!