ड्रैग एंड ड्रॉप
किसी आइटम को एक लक्ष्य तत्व या स्थिति पर खींचें।
जानकारी
इस कमांड की कार्यक्षमता अत्यधिक आपके ऐप में ड्रैग और ड्रॉप के कार्यान्वयन पर निर्भर करती है। यदि आप समस्याओं का अनुभव करते हैं तो कृपया अपना उदाहरण #4134 में पोस्ट करें।
उपयोग
$(selector).dragAndDrop(target, { duration })
पैरामीटर्स
नाम | टाइप | विवरण |
---|---|---|
target | Element, DragAndDropCoordinate | लक्ष्य तत्व या x और y गुणों वाला ऑब्जेक्ट |
options वैकल्पिक | DragAndDropOptions | dragAndDrop कमांड विकल्प |
options.duration वैकल्पिक | Number | ड्रैग कितने समय तक होना चाहिए |
उदाहरण
example.test.js
it('should demonstrate the dragAndDrop command', async () => {
const elem = $('#someElem')
const target = $('#someTarget')
// drag and drop to other element
await elem.dragAndDrop(target)
// drag and drop relative from current position
await elem.dragAndDrop({ x: 100, y: 200 })
})