简体   繁体   中英

jQuery UI dialog open

I'm trying to open a dialog window from code. The internet says to use $("#dialog").dialog("open"); but for some reason this isn't working.

$( "#draggable" ).draggable({
    connectToSortable: "#sortable",
    helper: "clone",
    revert: "invalid",
    stop: function(event, ui) {
      alert("Hello World!");
      $("dialog").dialog('open');
    }
  });
  $( "ul, li" ).disableSelection();
});
$(function() {
  $("#dialog").dialog({
    autoOpen: false,
    height: 200,
    width: 150
  });
});

I want it to open when a user stops moving one of the list items. The alert occurs but not the dialog. Anyone know why?

你错过了#

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM