Avatar of Eternal_Student
Eternal_StudentFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Drag/drop absolute div

I have a div that is positioned absolutely and it has some content inside including a scrolling div which contains unordered lists which contain links.

What I want to do is be able to drag this div and drop it [so only the container div is draggable.

I tried this script:

http://www.dynamicdrive.com/dynamicindex11/domdrag/

But when I try and scroll the inner div it attempts to drag when really all I want to do is scroll. So it seems that all of the child divs and elements have the drag too. I thought the z-index would hide the container div from the other divs.
Web Languages and StandardsJavaScript

Avatar of undefined
Last Comment
xtcharles
ASKER CERTIFIED SOLUTION
Avatar of xtcharles
xtcharles

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Eternal_Student

ASKER

I already have all of the functionality I need except for one function to drag an absolutely positioned div which has a scrollable div inside.

I always get overwhelmed by sciptaculous and other Javascript libraries.

Avatar of Eternal_Student

ASKER

Any ideas? Concerning my original question?
Avatar of xtcharles
xtcharles

Ok, well I think your best bet for a fast and working solution would be to try one of those libraries.

Usually it's extremely simple to implement something with one of those libraries. For example, to use the thickbox library, all you have to do is load the javascript and put a certain class name within what you wanted to control(In the case of thickbox, your <a> will now spawn a lightbox.).

I found within mootools a customizable download that has drag and drop includes.

Check it out here: http://mootools.net/download/ 
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo