| | |
Drag and Drop
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I found some good dragable layer code: http://www.howtocreate.co.uk/jslibs/
The code here allows you to create your own dhtml components that are moveable... I edited this code for my website: http://homepages.ihug.co.nz/~jlittle/index.html
But really drag and drop functionality is just drag functionality + knowing what the relationship is between objects.... if you can maintain a list of objects that have knowledge of their bounds... then you can use that implement drop functionality.
The code here allows you to create your own dhtml components that are moveable... I edited this code for my website: http://homepages.ihug.co.nz/~jlittle/index.html
But really drag and drop functionality is just drag functionality + knowing what the relationship is between objects.... if you can maintain a list of objects that have knowledge of their bounds... then you can use that implement drop functionality.
•
•
•
•
Originally Posted by belama
http://www.walterzorn.com/dragdrop/dragdrop_e.htmThis one is worth looking at.
Check for yourself.
I like it. Though I think it would take me a while to come up with a purpose for it
•
•
Join Date: Aug 2005
Posts: 2
Reputation:
Solved Threads: 0
Hi, I'm creating a calendar in open code using drag drop, so that people can drag a word likerevise into a box.
At the moment when you drag the word revise onto the calendar it will stay exactly where you leave it onmouseup, even if it is lying over two boxes on the calendar. Ideally what Is that if the word is more over a certain box onmouseup then it will relocate to that box.
this is like when playing solitair on windowsthe cards will snap to the correct place
Ideally this needs to all be in open code.
Thanks
SJ
At the moment when you drag the word revise onto the calendar it will stay exactly where you leave it onmouseup, even if it is lying over two boxes on the calendar. Ideally what Is that if the word is more over a certain box onmouseup then it will relocate to that box.
this is like when playing solitair on windowsthe cards will snap to the correct place
Ideally this needs to all be in open code.
Thanks
SJ
Hi,
I could edit your code for you. And publish the source, however I would be asking for US$60 an hour.
The problem is a little tricky... but if you are able to move the text already, then you have implemented about 60% of the core. And you know where the mouseup event occured, hence you have a mechanism of working out where you should 'snap' to.
The next problem is the 'snap'. I'd say the easiest way is to assign a mouseup event to each calendar cell, so when mouseup occurs you capture it in the cell you should be snapped to.
Then you will be able to work out the X and Y co-ordinates of your cell. And then you can snap your text.
Hmmm... sounds easy now.
I could edit your code for you. And publish the source, however I would be asking for US$60 an hour.
The problem is a little tricky... but if you are able to move the text already, then you have implemented about 60% of the core. And you know where the mouseup event occured, hence you have a mechanism of working out where you should 'snap' to.
The next problem is the 'snap'. I'd say the easiest way is to assign a mouseup event to each calendar cell, so when mouseup occurs you capture it in the cell you should be snapped to.
Then you will be able to work out the X and Y co-ordinates of your cell. And then you can snap your text.
Hmmm... sounds easy now.
•
•
Join Date: Aug 2005
Posts: 2
Reputation:
Solved Threads: 0
OK now my problem is that i want to save the position of the drag drop layers on the screen
If anyone wants to see what's been done already email sj669@homail.com and make the subject !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! and i will email you the code.
thanks
sj
If anyone wants to see what's been done already email sj669@homail.com and make the subject !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! and i will email you the code.
thanks
sj
yup, cookies are a good idea...
I have seen another reasonably good idea (depending on the implementation/function of your site) and that is what is done with http://www.tiddlywiki.com/ the idea is that it is a wiki that you can save on a usb stick and carry where ever you go (with a computer). As opposed to a normal wiki that is every where you go with a good internet connection.
And you are perhaps more advanced than this, but this page contains a very nice drag and drop example http://script.aculo.us/
I have seen another reasonably good idea (depending on the implementation/function of your site) and that is what is done with http://www.tiddlywiki.com/ the idea is that it is a wiki that you can save on a usb stick and carry where ever you go (with a computer). As opposed to a normal wiki that is every where you go with a good internet connection.
And you are perhaps more advanced than this, but this page contains a very nice drag and drop example http://script.aculo.us/
Last edited by alpha_foobar; Aug 24th, 2005 at 5:58 pm. Reason: grammar
![]() |
Similar Threads
- drag & drop (Assembly)
- create an app drag & drop controls in asp.net (ASP.NET)
- can't drag & drop in explorer + can't open link in new window (Windows NT / 2000 / XP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Javascript form managment on the fly!
- Next Thread: I just can't get this Javascript
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets automatically beta box browser bug captchaformproblem checkbox close codes createrange() css cursor debugger decimal dependent disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump listbox maps masterpage math media menu microsoft mp4 object onmouseoutdivproblem onreadystatechange paypal pdf php player position programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c window windowofwords windowsxp wysiwyg \n







