Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS Drag Drop

Status
Not open for further replies.

cfgcjm

Programmer
Oct 30, 2007
21
US
I've never done this for some i'm looking for any advice or examples anyone might have. I'm looking to Create a Drag & Drop shopping cart but I want the images to "Snap to" a Div. For example, if they are drug into a specified div they snap to a position in that div. If they are drug anywhere else they dont move from their original position.

Any help anyone can offer would be much appreciated
 
Well, for starters you can check this very handy script

Code:
[URL unfurl="true"]http://www.dynamicdrive.com/dynamicindex11/domdrag/[/URL]

You can then modify it to check the X,Y coordinate when dropped. If X,Y is within your expected range, you can accept the drop - else - bounce it back to its original spot.

Hope this helps!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top