gpt4 book ai didi

javascript - Sencha Touch 获取可拖动元素位置

转载 作者:行者123 更新时间:2023-11-28 02:40:53 24 4
gpt4 key购买 nike

有什么方法可以在拖动面板时获取面板的当前垂直位置吗?

我有这样的东西:

Ext.define("App.DashboardDrawer",
{
extend: 'Ext.Panel',
xtype: 'dashboarddrawer',

config: {
cls: 'w-drawer',
height: '380px',
zIndex: 99999,
id: 'drawer-container',
docked: 'bottom',
draggable:{
direction:'vertical',
constraint: {
min: { x: 0, y: 0 },
max: { x: 0, y: 338 }
}
},
listeners:{
drag: function(list, idx, target, record, evt) {
// I'd like to get the current position of the panel here

}
},
...

谢谢。

最佳答案

试试这个。它对我有用。

        Ext.define('Stackoverflow.view.Demo', {
extend: 'Ext.Panel',
alias: 'widget.demo',

config:
{
draggable:{
direction:'vertical',
constraint: {
min: { x: 0, y: 0 },
max: { x: 0, y: 338 }
},
listeners: {
drag: function( draggable, evt, offsetX, offsetY, eOpts ) {
console.log( offsetX);
}
}}
}
});

关于javascript - Sencha Touch 获取可拖动元素位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12664350/

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