gpt4 book ai didi

javascript - Dialog 中的事件和 UI 参数是什么

转载 作者:数据小太阳 更新时间:2023-10-29 03:54:39 27 4
gpt4 key购买 nike

jQuery 对话框中的事件和 UI 参数是什么?我可以使用它们获取鼠标位置吗?

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

最佳答案

事件参数是DOM Event object . ui 参数通常是一个散列;它的属性取决于引发的事件。
对于对话框 open 事件,两个参数似乎都为空。对于其他事件,例如 dragStartdragdragStopui 将包含当前位置和偏移量:

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

关于javascript - Dialog 中的事件和 UI 参数是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3547322/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com