- 浏览: 83043 次
- 性别:
- 来自: 福州
文章分类
最新评论
-
junes_yu:
感谢分享~这个有用!
设置 Eclipse/MyEclipse Alt+/ 快速提示快捷键 -
wangxinyyl:
很好很强大,研究了半天,还是这个办法靠谱
html 中的file文件域 -
yangxiutian:
以后继续发一些关于浏览器兼容的问题
html 中的file文件域 -
yangxiutian:
谢谢你 我找这个找好久了。就是IE6的问题,其他浏览器都 ...
html 中的file文件域 -
mytream:
非常感谢,,用的好好的换了个版本就没这功能了,,咚咚咚响,听 ...
设置 Eclipse/MyEclipse Alt+/ 快速提示快捷键
5 Steps to Understanding Drag and Drop with Ext JS
September 13, 2009 by Jay Garcia
http://www.extjs.com/blog/2009/09/13/5-steps-drag-and-drop-with-ext-js/
One of the most powerful interaction design patterns available to developers is “Drag and Drop.” We utilize Drag and Drop without really giving it much thought – especially when its done right. Here are 5 easy steps to ensure an elegant implementation.
Defining drag and drop
A drag operation, essentially, is a click gesture on some UI element while the mouse button is held down and the mouse is moved. A drop operation occurs when the mouse button is released after a drag operation.
From a high level, drag and drop decisions can be summed up by the following flow chart.
To speed up our development, Ext JS provides us with the Ext.dd classes to manage the basic decisions for us. In this post, we will cover coding for the appearance and removal of the drop invitation, invalid drop repair and what happens when a successful drop occurs.
Organzing the drag and drop classes
A first glance of the classes in the Ext.dd documentation might seem a bit intimidating. But, if we take a quick moment to look at the classes, we see that they all stem from the DragDrop class and most can be categorized into Drag or Drop groups. With a bit more time and digging, we can see that the classes can be further categorized into single node and multiple node drag or drop interactions.
In order to learn about the basics of drag and drop we’ll focus on applying single drag and drop interactions to DOM nodes. To do this, we’ll utilize the DD and DDTarget classes, which provide the base implementations for their respective drag and drop behaviors.
However, we need to discuss what our objectives are before we can start implementing drag and drop.
The task at hand
Lets say we’ve been asked to develop an application that will provide a rental car company the ability to place their cars and trucks in one of three states: available, rented or in repair status. The cars and trucks are only allowed to be placed in their respective “available” container.
To get started, we must make the cars and trucks “dragable”. For this, we’ll use DD. We’ll need to make the rented, repair and vehicle containers “drop targets”. For this we’ll use DDTarget. Lastly, we’ll use different drag drop groups to help enforce the requirement that cars and trucks can only be dropped into their respective “available” containers.
The HTML and CSS for this example is already constructed and can be downloaded here. With that downloaded, we can begin coding by adding drag operations to the cars and trucks.
Step 1: Starting with drag
To configure the vehicle DIVs elements as dragable, we’ll need to obtain a list and loop through it to instantiate new instances of DD. Here’s how we do it.
All drag and drop classes are designed to be implemented by means of overriding its methods. That’s why in the above code segment, we have create an empty object called overrides, which will be filled in later with overrides specific to the action we need.
We get of list of car and truck elements by leveraging the DomQuery select method to query the cars container for all the child div elements.
To make the cars and truck elements dragable, we create a new instance of DD, passing in the car or truck element to be dragged and the drag drop group that it is to participate in. Notice that the vehicle types have their own respective drag drop group. This will be important to remember later when we setup the rented and repair containers as drop targets.
Also notice that we’re applying the overrides object to the newly created instances of DD using Ext.apply., which is a handy way to add properties or methods to an existing object.
Before we can continue with our implementation, we need to take a quick moment to analyze what happens when you drag an element on screen. With this understanding, the rest of the implementation will fall into place.
Peeking at how drag nodes are affected
The first thing you’ll notice when dragging the car or truck elements around is that they will stick wherever they are dropped. This is OK for now because we’ve just begun our implementation. What is important is to understand how the drag nodes are being affected. This will aid us in coding for the return to their original positions when they are dropped on anything that is a valid drop target, which is known as an “invalid drop”.
The below illustration uses FireBug’s HTML inspection panel and highlights the changes being made by when a drag operation is applied to the Camaro element.
Click the above image to test the drag operation.
While inspecting the drag element during a drag operation, we can see a style attribute added to the element with three CSS values populated: position, top and left. Further inspection reveals that the position attribute set to relative and top and left attributes updating while the node is being dragged around.
After a the drag gesture completes, the style attribute remains along with the styles contained therein. This is what we have to clean up when we code for the repair of an invalid drop. Until we setup proper drop targets, all drop operations are considered invalid.
Step 2: Repairing an invalid drop
The path of least resistance is to repair an invalid drop by reseting the style attribute that is applied during the drag operation. This means that the drag element would disappear from under the mouse and reappear where it originated and would be quite boring. To make it smoother, we’ll use Ext.Fx to animate this action.
Remember that the drag and drop classes were designed to have methods overridden. To implement repair, we’ll need to override the b4StartDrag, onInvalidDrop and endDrag methods.
Lets add the following methods to our overrides object above and we’ll discuss what they are and do.
In the above code, we begin by overriding the b4StartDrag method, which is called the instant the drag element starts being dragged around screen and makes it an ideal place to cache the drag element and original XY coordinates – which we will use later on in this process.
Next, we override onInvalidDrop, which is is called when a drag node is dropped on anything other than a drop target that is participating in the same drag drop group. This override simply sets a local invalidDrop property to true, which will be used in the next method.
The last method we override is endDrag, which is called when the drag element is no longer being dragged around screen and the drag element is no longer being controlled by the mouse movements. This override will move the drag element back to its original X and Y position using animation. We configured the animation to use the elasticOut easing to provide a cool and fun bouncy effect at end of the animation.
Click the above image to view the animated repair operation in action.
OK, now we have the repair operation complete. In order for it to work on the drop invitation and valid drop operations, we need to setup the drop targets.
Step 3: Configuring the drop targets
Our requirements dictate that we will allow cars and trucks to be in be dropped in the rented and repair containers as well as their respective original containers. To do this, we’ll need to instantiate instances of the DDTarget class.
Here’s how its done.
In the above code snippet, we have setup drop targets for the cars, trucks, rented and repair elements. Notice that the cars container element only participates in the “carsDDGroup” and the trucks container element participates in the “trucksDDGroup”. This helps enforce the requirement that cars and trucks can only be dropped in their originating container.
Next, we instantiate instances DDTarget for the rented and repair elements. Initially, they are configured to only participate in the “carsDDGroup”. In order to allow them to participate in the “trucksDDGroup”, we have to add it by means of addToGroup.
OK, now we’ve configured our drop targets. Lets see what happens when we drop the cars or trucks on a valid drop element.
Click the above image see the progress thus far.
In exercising the drop targets, we see that the drag element stays exactly its dropped. That is, images can be dropped anywhere on a drop target and stay there. This means that our drop implementation is not complete.
To complete it, we need to actually code for the “complete drop” operation, by means of another override for the instances of DD that we created some time ago.
Step 4: Completing the drop
To complete the drop, we will need to actually drag the element from its parent element to the drop target element using DOM tools. This is accomplished by overriding the DD onDragDrop method.
Add the following method to the overrides object.
In the above override, the drag element is moved to the drop target element, but only if it is not the same as the drag element’s parent node. After the drag element is moved, the styles are cleared from it.
If the drop element is the same as the drag element’s parent, we ensure a repair operation occurs by calling this.onInvalidDrop.
Click the above image to see the complete drop operation in action.
Upon a successful drop, the drag elements will now will be moved from their parent element to the drop target.
How does the user know if they are hovering above a valid drop target? We’ll give the user some visual feedback by configuring the drop invitation.
Step 5: Adding drop invitation
In order to make drag and drop a bit more useful, we need to provide feedback to the user on whether or not a drop operation can successfully occur. This means that we’ll have to override the onDragEnter and onDragOut methods
Add these last two methods to the overrides object.
In the above code, we override the onDragEnter and onDragOut methods, both of which are only utilized when the drag element is interacting with a drop target participating in the same drag drop group.
The onDragEnter method is only called when the mouse cursor first intersects the boundaries of a drop target while a drag item is in drag mode. Likewise, onDragOut is called when the mouse cursor is first dragged outside the boundaries of the drop target while in drag mode.
Click the above image to see the drop invitation.
By adding overrides to the onDragEnter and onDragOut methods we can see that the background of the drag element will turn green when the mouse cursor first intersects a valid drop target and will lose its green background when it leaves the drop target or is dropped. This completes our implementation of drag and drop with DOM elements.
It doesn’t stop here
Drag and drop can be a can be applied to mostly everything in the Ext JS framework. Here are a few examples that you can use to learn how to implement drag and drop with various widgets:
GridPanel to GridPanel
Grid to FormPanel
Ext.form.Field to GridPanel cell
Use of DragZone and DropZone
DataView to TreePanel
Summary
Today, we learned how to implement end to end drag and drop of DOM nodes using the first-level drag and drop implementation classes. From a high-level, we defined and discussed what drag and drop is and how to think about it in terms of the framework.
We also learned that the drag and drop classes can be grouped by drag or drop behaviors and whether or not they support single or multiple drag or drop operations. While implementing this behavior, we illustrated that the dd classes help make some of the behavioral decisions, and that we are responsible for coding the end-behaviors.
We hope you’ve enjoyed this thorough look at some fundamental drag and drop operations with DOM nodes. We look forward to bringing you more articles about this topic in the future.
September 13, 2009 by Jay Garcia
http://www.extjs.com/blog/2009/09/13/5-steps-drag-and-drop-with-ext-js/
One of the most powerful interaction design patterns available to developers is “Drag and Drop.” We utilize Drag and Drop without really giving it much thought – especially when its done right. Here are 5 easy steps to ensure an elegant implementation.
Defining drag and drop
A drag operation, essentially, is a click gesture on some UI element while the mouse button is held down and the mouse is moved. A drop operation occurs when the mouse button is released after a drag operation.
From a high level, drag and drop decisions can be summed up by the following flow chart.
To speed up our development, Ext JS provides us with the Ext.dd classes to manage the basic decisions for us. In this post, we will cover coding for the appearance and removal of the drop invitation, invalid drop repair and what happens when a successful drop occurs.
Organzing the drag and drop classes
A first glance of the classes in the Ext.dd documentation might seem a bit intimidating. But, if we take a quick moment to look at the classes, we see that they all stem from the DragDrop class and most can be categorized into Drag or Drop groups. With a bit more time and digging, we can see that the classes can be further categorized into single node and multiple node drag or drop interactions.
In order to learn about the basics of drag and drop we’ll focus on applying single drag and drop interactions to DOM nodes. To do this, we’ll utilize the DD and DDTarget classes, which provide the base implementations for their respective drag and drop behaviors.
However, we need to discuss what our objectives are before we can start implementing drag and drop.
The task at hand
Lets say we’ve been asked to develop an application that will provide a rental car company the ability to place their cars and trucks in one of three states: available, rented or in repair status. The cars and trucks are only allowed to be placed in their respective “available” container.
To get started, we must make the cars and trucks “dragable”. For this, we’ll use DD. We’ll need to make the rented, repair and vehicle containers “drop targets”. For this we’ll use DDTarget. Lastly, we’ll use different drag drop groups to help enforce the requirement that cars and trucks can only be dropped into their respective “available” containers.
The HTML and CSS for this example is already constructed and can be downloaded here. With that downloaded, we can begin coding by adding drag operations to the cars and trucks.
Step 1: Starting with drag
To configure the vehicle DIVs elements as dragable, we’ll need to obtain a list and loop through it to instantiate new instances of DD. Here’s how we do it.
// Create an object that we'll use to implement and override drag behaviors a little later var overrides = {}; // Configure the cars to be draggable var carElements = Ext.get('cars').select('div'); Ext.each(carElements.elements, function(el) { var dd = new Ext.dd.DD(el, 'carsDDGroup', { isTarget : false }); //Apply the overrides object to the newly created instance of DD Ext.apply(dd, overrides); }); var truckElements = Ext.get('trucks').select('div'); Ext.each(truckElements.elements, function(el) { var dd = new Ext.dd.DD(el, 'trucksDDGroup', { isTarget : false }); Ext.apply(dd, overrides); });
All drag and drop classes are designed to be implemented by means of overriding its methods. That’s why in the above code segment, we have create an empty object called overrides, which will be filled in later with overrides specific to the action we need.
We get of list of car and truck elements by leveraging the DomQuery select method to query the cars container for all the child div elements.
To make the cars and truck elements dragable, we create a new instance of DD, passing in the car or truck element to be dragged and the drag drop group that it is to participate in. Notice that the vehicle types have their own respective drag drop group. This will be important to remember later when we setup the rented and repair containers as drop targets.
Also notice that we’re applying the overrides object to the newly created instances of DD using Ext.apply., which is a handy way to add properties or methods to an existing object.
Before we can continue with our implementation, we need to take a quick moment to analyze what happens when you drag an element on screen. With this understanding, the rest of the implementation will fall into place.
Peeking at how drag nodes are affected
The first thing you’ll notice when dragging the car or truck elements around is that they will stick wherever they are dropped. This is OK for now because we’ve just begun our implementation. What is important is to understand how the drag nodes are being affected. This will aid us in coding for the return to their original positions when they are dropped on anything that is a valid drop target, which is known as an “invalid drop”.
The below illustration uses FireBug’s HTML inspection panel and highlights the changes being made by when a drag operation is applied to the Camaro element.
Click the above image to test the drag operation.
While inspecting the drag element during a drag operation, we can see a style attribute added to the element with three CSS values populated: position, top and left. Further inspection reveals that the position attribute set to relative and top and left attributes updating while the node is being dragged around.
After a the drag gesture completes, the style attribute remains along with the styles contained therein. This is what we have to clean up when we code for the repair of an invalid drop. Until we setup proper drop targets, all drop operations are considered invalid.
Step 2: Repairing an invalid drop
The path of least resistance is to repair an invalid drop by reseting the style attribute that is applied during the drag operation. This means that the drag element would disappear from under the mouse and reappear where it originated and would be quite boring. To make it smoother, we’ll use Ext.Fx to animate this action.
Remember that the drag and drop classes were designed to have methods overridden. To implement repair, we’ll need to override the b4StartDrag, onInvalidDrop and endDrag methods.
Lets add the following methods to our overrides object above and we’ll discuss what they are and do.
// Called the instance the element is dragged. b4StartDrag : function() { // Cache the drag element if (!this.el) { this.el = Ext.get(this.getEl()); } //Cache the original XY Coordinates of the element, we'll use this later. this.originalXY = this.el.getXY(); }, // Called when element is dropped not anything other than a dropzone with the same ddgroup onInvalidDrop : function() { // Set a flag to invoke the animated repair this.invalidDrop = true; }, // Called when the drag operation completes endDrag : function() { // Invoke the animation if the invalidDrop flag is set to true if (this.invalidDrop === true) { // Remove the drop invitation this.el.removeClass('dropOK'); // Create the animation configuration object var animCfgObj = { easing : 'elasticOut', duration : 1, scope : this, callback : function() { // Remove the position attribute this.el.dom.style.position = ''; } }; // Apply the repair animation this.el.moveTo(this.originalXY[0], this.originalXY[1], animCfgObj); delete this.invalidDrop; } },
In the above code, we begin by overriding the b4StartDrag method, which is called the instant the drag element starts being dragged around screen and makes it an ideal place to cache the drag element and original XY coordinates – which we will use later on in this process.
Next, we override onInvalidDrop, which is is called when a drag node is dropped on anything other than a drop target that is participating in the same drag drop group. This override simply sets a local invalidDrop property to true, which will be used in the next method.
The last method we override is endDrag, which is called when the drag element is no longer being dragged around screen and the drag element is no longer being controlled by the mouse movements. This override will move the drag element back to its original X and Y position using animation. We configured the animation to use the elasticOut easing to provide a cool and fun bouncy effect at end of the animation.
Click the above image to view the animated repair operation in action.
OK, now we have the repair operation complete. In order for it to work on the drop invitation and valid drop operations, we need to setup the drop targets.
Step 3: Configuring the drop targets
Our requirements dictate that we will allow cars and trucks to be in be dropped in the rented and repair containers as well as their respective original containers. To do this, we’ll need to instantiate instances of the DDTarget class.
Here’s how its done.
//Instantiate instances of Ext.dd.DDTarget for the cars and trucks container var carsDDTarget = new Ext.dd.DDTarget('cars','carsDDGroup'); var trucksDDTarget = new Ext.dd.DDTarget('trucks', 'trucksDDGroup'); //Instantiate instnaces of DDTarget for the rented and repair drop target elements var rentedDDTarget = new Ext.dd.DDTarget('rented', 'carsDDGroup'); var repairDDTarget = new Ext.dd.DDTarget('repair', 'carsDDGroup'); //Ensure that the rented and repair DDTargets will participate in the trucksDDGroup rentedDDTarget.addToGroup('trucksDDGroup'); repairDDTarget.addToGroup('trucksDDGroup');
In the above code snippet, we have setup drop targets for the cars, trucks, rented and repair elements. Notice that the cars container element only participates in the “carsDDGroup” and the trucks container element participates in the “trucksDDGroup”. This helps enforce the requirement that cars and trucks can only be dropped in their originating container.
Next, we instantiate instances DDTarget for the rented and repair elements. Initially, they are configured to only participate in the “carsDDGroup”. In order to allow them to participate in the “trucksDDGroup”, we have to add it by means of addToGroup.
OK, now we’ve configured our drop targets. Lets see what happens when we drop the cars or trucks on a valid drop element.
Click the above image see the progress thus far.
In exercising the drop targets, we see that the drag element stays exactly its dropped. That is, images can be dropped anywhere on a drop target and stay there. This means that our drop implementation is not complete.
To complete it, we need to actually code for the “complete drop” operation, by means of another override for the instances of DD that we created some time ago.
Step 4: Completing the drop
To complete the drop, we will need to actually drag the element from its parent element to the drop target element using DOM tools. This is accomplished by overriding the DD onDragDrop method.
Add the following method to the overrides object.
// Called upon successful drop of an element on a DDTarget with the same onDragDrop : function(evtObj, targetElId) { // Wrap the drop target element with Ext.Element var dropEl = Ext.get(targetElId); // Perform the node move only if the drag element's // parent is not the same as the drop target if (this.el.dom.parentNode.id != targetElId) { // Move the element dropEl.appendChild(this.el); // Remove the drag invitation this.onDragOut(evtObj, targetElId); // Clear the styles this.el.dom.style.position =''; this.el.dom.style.top = ''; this.el.dom.style.left = ''; } else { // This was an invalid drop, initiate a repair this.onInvalidDrop(); }
In the above override, the drag element is moved to the drop target element, but only if it is not the same as the drag element’s parent node. After the drag element is moved, the styles are cleared from it.
If the drop element is the same as the drag element’s parent, we ensure a repair operation occurs by calling this.onInvalidDrop.
Click the above image to see the complete drop operation in action.
Upon a successful drop, the drag elements will now will be moved from their parent element to the drop target.
How does the user know if they are hovering above a valid drop target? We’ll give the user some visual feedback by configuring the drop invitation.
Step 5: Adding drop invitation
In order to make drag and drop a bit more useful, we need to provide feedback to the user on whether or not a drop operation can successfully occur. This means that we’ll have to override the onDragEnter and onDragOut methods
Add these last two methods to the overrides object.
// Only called when the drag element is dragged over the a drop target with the same ddgroup onDragEnter : function(evtObj, targetElId) { // Colorize the drag target if the drag node's parent is not the same as the drop target if (targetElId != this.el.dom.parentNode.id) { this.el.addClass('dropOK'); } else { // Remove the invitation this.onDragOut(); } }, // Only called when element is dragged out of a dropzone with the same ddgroup onDragOut : function(evtObj, targetElId) { this.el.removeClass('dropOK'); }
In the above code, we override the onDragEnter and onDragOut methods, both of which are only utilized when the drag element is interacting with a drop target participating in the same drag drop group.
The onDragEnter method is only called when the mouse cursor first intersects the boundaries of a drop target while a drag item is in drag mode. Likewise, onDragOut is called when the mouse cursor is first dragged outside the boundaries of the drop target while in drag mode.
Click the above image to see the drop invitation.
By adding overrides to the onDragEnter and onDragOut methods we can see that the background of the drag element will turn green when the mouse cursor first intersects a valid drop target and will lose its green background when it leaves the drop target or is dropped. This completes our implementation of drag and drop with DOM elements.
It doesn’t stop here
Drag and drop can be a can be applied to mostly everything in the Ext JS framework. Here are a few examples that you can use to learn how to implement drag and drop with various widgets:
GridPanel to GridPanel
Grid to FormPanel
Ext.form.Field to GridPanel cell
Use of DragZone and DropZone
DataView to TreePanel
Summary
Today, we learned how to implement end to end drag and drop of DOM nodes using the first-level drag and drop implementation classes. From a high-level, we defined and discussed what drag and drop is and how to think about it in terms of the framework.
We also learned that the drag and drop classes can be grouped by drag or drop behaviors and whether or not they support single or multiple drag or drop operations. While implementing this behavior, we illustrated that the dd classes help make some of the behavioral decisions, and that we are responsible for coding the end-behaviors.
We hope you’ve enjoyed this thorough look at some fundamental drag and drop operations with DOM nodes. We look forward to bringing you more articles about this topic in the future.
相关推荐
"Java中的Drag and Drop拖拽技术" Java中的Drag and Drop拖拽技术是指在Java应用程序中,实现拖拽操作的技术。Drag and Drop技术可以将数据从一个组件拖拽到另一个组件中,实现数据的传输和交互操作。 Drag and ...
在Android开发中,拖放(Drag and Drop)功能是一种常见的用户交互方式,允许用户通过手势将一个对象从一处移动到另一处。这个功能在许多场景下都非常实用,比如整理应用抽屉、移动文件或者在布局中调整控件位置等。...
在Android开发中,拖放(DragAndDrop)功能是一个常用且有趣的交互方式,它允许用户通过手势将一个视图移动到另一个位置,或者在不同的视图之间传递数据。本示例将详细介绍如何实现一个简单的拖放操作,并解决你在...
本资料"DragandDrop.rar_dragAndDrop"聚焦于在Internet Explorer(IE)浏览器中实现文件拖放的扩展功能,为开发者提供了宝贵的指导。 文件拖放技术的核心在于HTML5中的Drag and Drop API,这是一个强大的功能,使得...
《Drag and Drop Component Suite 3.7:Delphi中的拖放技术详解》 在软件开发过程中,用户界面的易用性和交互性是至关重要的因素之一。"Drag and Drop Component Suite 3.7"是一个专为Delphi开发者设计的组件包,它...
【标题】"DragAndDrop_Demo源码"是关于C++编程的一个实例,主要展示了拖放(Drag and Drop)功能的实现。在计算机图形用户界面(GUI)开发中,拖放功能允许用户通过鼠标或其他输入设备将一个对象从一处拖动到另一处...
HTML5是现代网页开发的重要标准,它引入了许多新特性,其中拖放(Drag and Drop)功能就是一项增强用户交互体验的重要接口。拖放接口允许用户通过鼠标或触控设备将元素从一个位置拖动到另一个位置,使得网页的互动性...
在C#编程中,Drag and Drop操作是一种常见且实用的功能,允许用户通过鼠标将对象从一个位置拖动到另一个位置,比如在不同的控件、窗口甚至应用程序之间移动数据。这个功能在开发桌面应用时,特别是在文件管理或者...
表格拖拽排序插件 Table Drag and Drop JQuery plugin v0.7 最新0.7版本
Vue DnD Mobile,全称为"Vue Drag and Drop Mobile",是专门为Vue.js开发的一个拖放库,专为移动设备优化,使得在触摸屏上的交互变得更加自然和流畅。 拖放(Drag and Drop,简称DnD)是一种常见的用户交互模式,...
"DragAndDrop_src源码" 是一个专门针对C++编程语言设计的项目,它提供了实现拖放(Drag and Drop)功能的源代码。在Windows应用开发中,拖放操作是常见的用户交互方式,允许用户通过鼠标将一项内容从一处拖动到另一...
"Drag and Drop Component Suite Version 5.2 Full Source" 是一个专门用于开发具有拖放功能的组件套件的完整源代码版本。这个组件库通常是为了帮助程序员在应用程序中实现更直观、用户友好的交互设计而设计的。在这...
本文将详细介绍Drag and Drop API的基本概念、事件处理、以及如何在JavaScript中使用这个API来实现拖拽功能。 Drag and Drop API为Web应用带来了强大的交互性。通过本文的介绍和示例代码,开发者应该能够理解并实现...
在Windows Presentation Foundation (WPF) 中,鼠标拖放操作(DragAndDrop)是一种常见的用户交互方式,它允许用户通过鼠标将一个元素从一处移动到另一处。这种功能在各种应用程序中都有广泛的应用,例如文件管理器...
标题 "Ole Drag and Drop Example" 提供了一个关于如何在应用程序中实现OLE拖放操作的示例。在编程中,OLE(Object Linking and Embedding)是微软开发的一种技术,允许不同应用程序之间的数据共享和交互。拖放功能...
标题 "Right Button Drag and Drop with Popup Menu(5KB)" 提示我们这个压缩包可能包含一个实现右键拖放功能并带有弹出菜单的程序或代码示例。这通常涉及到计算机图形用户界面(GUI)编程,特别是在Windows环境中。...
本篇文章将深入探讨如何使用jQuery实现拖放(Drag and Drop)功能,特别是针对图片的拖放操作。拖放功能是网页交互中常见的一种增强用户体验的方式,常用于文件上传、页面元素排序等场景。 首先,我们需要引入jQuery...
对于Delphi开发者来说,"The Drag and Drop Component Suite for Delphi XE10"是一款非常实用的工具,它极大地简化了在Delphi XE10环境下实现拖放功能的复杂度。 该组件套件是基于先前版本XE7的修改版,经过优化后...
在iOS 11中,Apple引入了一项名为“Drag and Drop”的强大功能,极大地提升了用户在设备上处理和移动内容的便捷性。这个功能允许用户通过简单的手势将内容(如文本、图片、文件等)从一个应用拖动到另一个应用,从而...
综上所述,“Draganddrop.html”示例是一个关于如何利用HTML5的拖放API创建交互式Web应用的实践案例。通过阅读和分析源码,我们可以深入理解拖放功能的工作原理,以及如何将其应用于实际项目中。