最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What are event and UI parameters in Dialog - Stack Overflow

programmeradmin0浏览0评论

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

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

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

$( ".selector" ).dialog({
   open: function(event, ui) { ... }
});
Share Improve this question asked Aug 23, 2010 at 12:07 MayurMayur 3,09710 gold badges44 silver badges55 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

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);
    }
});
发布评论

评论列表(0)

  1. 暂无评论