Draggable objects

L

Lorenzo Thurman

I'd like for some elements to be draggable. I've found some code
examples around the 'net on how to do this, but I have one requirement
that none of them addresses:

The item I need to move is a "popup" in a hidden div that gets displayed
when a user clicks on another element. This "popup" has a border at the
top. When a user clicks and drags the border, I want the popup to
"drag". I don't want the popup to respond if the body of the popup is
clicked and dragged.

I hope that was clear. Is there anyway to do this?
TIA
 
P

Phrogz

The item I need to move is a "popup" in a hidden div that gets displayed
when a user clicks on another element. This "popup" has a border at the
top. When a user clicks and drags the border, I want the popup to
"drag". I don't want the popup to respond if the body of the popup is
clicked and dragged.

Option 1) Put your drag handler on the whole window, and catch and
stopPropagation() for the event that starts the drag operation on the
'contents' div.

Option 2) Put your drag handler just on the title bar, but write your
code to allow for specifying an alternate object to be dragged.

(This latter is probably the easier more general approach, but requires
that you know how to actually code.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top