What are event and UI parameters in Dialog

余生颓废 提交于 2019-12-22 04:18:20

问题


What are event and UI parameters in jQuery Dialog? Can I get a mouse position using them?

$( ".selector" ).dialog({
   open: function(event, ui) { ... }
});

回答1:


The event parameter is the DOM Event object. The ui parameter is typically a hash; its properties depend on the event being raised.
For the dialog open event, both arguments appear to be null. For other events, such as dragStart, drag and dragStop, ui will contain the current position and offset:

$('.selector').dialog({
    drag: function(event, ui) {
        console.log("Current position: " + ui.position);
    }
});


来源:https://stackoverflow.com/questions/3547322/what-are-event-and-ui-parameters-in-dialog

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