Skip to main content

Search and Top Navigation

#8413 closed feature (worksforme)

Opened June 26, 2012 11:33AM UTC

Closed June 26, 2012 12:18PM UTC

Add HTML class to BODY tag when dragging an element

Reported by: toinus Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.draggable Version: 1.8.20
Keywords: Cc:
Blocked by: Blocking:
Description

It would be great to have an extra CSS class added to the BODY element when something is dragged. So far only an inline style is set : 'cursor: move'.

Adding a class (like 'drag-on') would let define useful CSS styles like :

body.drag-on .empty-container { border: 1px dashed #CCCCCC }

to easily identify where the element could be dragged to, while not perturbing the user until a drag-drop action is initiated.

Attachments (0)
Change History (1)

Changed June 26, 2012 12:18PM UTC by rdworth comment:1

resolution: → worksforme
status: newclosed

This already exists. See http://docs.jquery.com/UI/Droppable#option-activeClass for documentation and http://jqueryui.com/demos/droppable/#visual-feedback for a demo (the second drag-drop pair).

If you want a class added to the html element, use the dragstart and dragstop events to add and remove it.