By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Draggable objects

P: n/a
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
Oct 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.)

Oct 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.