jQuery UI Examples - Droppable
Creates targets for draggable widgets.
For more details about the droppable interaction, see the API documentation Droppable Widget。
Default functionality
Enables droppable functionality on any DOM element and creates targets for draggable widgets.
jQuery UI 放置(Droppable) - 默认功能
accept
Use accept The option specifies which element (or group of elements) the target droppable accepts.
jQuery UI 放置(Droppable) - 接受
Prevent propagation
When using nested droppables - for example, you might have a tree-shaped editable directory structure with folder and document nodes - greedy Set the option to true to prevent event propagation when a draggable is dropped on a child node (droppable).
jQuery UI 放置(Droppable) - 防止传播
Restore the draggable's position
When a draggable with the boolean revert option set stops dragging, returns the draggable (or its helper) to its original position.
jQuery UI 放置(Droppable) - 还原 draggable 的位置
Shopping cart demo
Demonstrates how to use an accordion to display a product catalog structure, use drag and drop to add products to the cart, and sort the products in the cart.
jQuery UI 放置(Droppable) - 购物车演示
产品
购物车
Simple photo manager
You can delete photos by dragging them to the trash or clicking the trash icon.
You can restore photos by dragging them to the album or clicking the recycle icon.
You can view a larger image by clicking the zoom icon. The jQuery UI dialog widget is used for the modal window.
jQuery UI 放置(Droppable) - 简单的照片管理器
Visual feedback
Change the appearance of a droppable when hovering over it or when it is active (that is, when an acceptable draggable is dropped on the droppable). Use the hoverClass or activeClass option to specify the respective classes.
jQuery UI 放置(Droppable) - 视觉反馈
当悬停在 droppable 上时的反馈:
当激活 draggable 时的反馈: