473,657 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

drag-n-drop

I need a drag-n-drop script.. I have found one here..
http://javascript.internet.com/page-...ag-n-drop.html

each div containing an image has an id, and each image has a name, as in

<div id="h" style="position :absolute;left: 100;top:350;">
<img src=http://javascript.inte rnet.com/img/cards/hearts.gif name="h">
</div>

but I don't see where he references these id's and names in the JS code..

functions are declared with param 'e', but I don't see this param being
passed to the functions when they're called (called thus:
document.onmous edown = MD;.. etc..)

I need to apply this to a div (which contains a table), but if I put the
same id and name to my <divas he has here for one of the images it
doesn't work..

what am I missing please.. thank you..

Aug 8 '06 #1
14 3096
maya wrote:
I need a drag-n-drop script.. I have found one here..
http://javascript.internet.com/page-...ag-n-drop.html

each div containing an image has an id, and each image has a name, as in

<div id="h" style="position :absolute;left: 100;top:350;">
<img src=http://javascript.inte rnet.com/img/cards/hearts.gif name="h">
</div>

but I don't see where he references these id's and names in the JS code..

functions are declared with param 'e', but I don't see this param being
passed to the functions when they're called (called thus:
document.onmous edown = MD;.. etc..)

I need to apply this to a div (which contains a table), but if I put the
same id and name to my <divas he has here for one of the images it
doesn't work..

what am I missing please.. thank you..
ok, I got it to work for my table, but only if I drag from edges of
table, not inside table.. is there a way to do this?

thanks again..
Aug 8 '06 #2

maya wrote:
I need a drag-n-drop script.. I have found one here..
http://javascript.internet.com/page-...ag-n-drop.html
That script is not very good. Doesn't even work in Firefox. Instead,
check these out:
http://www.dhtmlgoodies.com/index.html?page=dragDrop
http://www.walterzorn.com/dragdrop/dragdrop_e.htm

Aug 9 '06 #3

maya wrote:
I need a drag-n-drop script.. I have found one here..
http://javascript.internet.com/page-...ag-n-drop.html

each div containing an image has an id, and each image has a name, as in

<div id="h" style="position :absolute;left: 100;top:350;">
<img src=http://javascript.inte rnet.com/img/cards/hearts.gif name="h">
</div>

but I don't see where he references these id's and names in the JS code..

functions are declared with param 'e', but I don't see this param being
passed to the functions when they're called (called thus:
document.onmous edown = MD;.. etc..)

I need to apply this to a div (which contains a table), but if I put the
same id and name to my <divas he has here for one of the images it
doesn't work..
The script you use is very old and likely comes from the browser war
era. It is not likely to work on some modern browsers.

Lasse Reichstein Nielsen who often posts here gave a good modern drag
script here about 2 years ago, and works on all of the modern browsers
on which I have tested it. You could likely find his post with a search
at Goggle. However, to save time, you might look at two of my pages at
http://cwdjr.net/test/newDrag.html and
http://www.cwdjr.net/test/picturePuzzle.html . You will see how the
script will work to drag images, text, and a division that contains 3
images.

Aug 9 '06 #4

cwdjrxyz wrote:
You could likely find his post with a search
at Goggle. However, to save time, you might look at two of my pages at
http://cwdjr.net/test/newDrag.html and
http://www.cwdjr.net/test/picturePuzzle.html . You will see how the
script will work to drag images, text, and a division that contains 3
images.
These pages are written in xhtml 1.1 strict, but are only being server
as html. I have never gotten around to doing this, but you should have
no problem even if you serve your page as html 4.01 transitional. The
script will work fine and validate up to xhtml 1.1 without having to
use CDATA tags or using an external script.

Aug 9 '06 #5
cwdjrxyz wrote:
cwdjrxyz wrote:
>You could likely find his post with a search
at Goggle. However, to save time, you might look at two of my pages at
http://cwdjr.net/test/newDrag.html and
http://www.cwdjr.net/test/picturePuzzle.html . You will see how the
script will work to drag images, text, and a division that contains 3
images.

These pages are written in xhtml 1.1 strict, but are only being server
as html. I have never gotten around to doing this, but you should have
no problem even if you serve your page as html 4.01 transitional. The
script will work fine and validate up to xhtml 1.1 without having to
use CDATA tags or using an external script.
thank you all very much!!
Aug 9 '06 #6
cwdjrxyz wrote:
maya wrote:
>I need a drag-n-drop script.. I have found one here..
http://javascript.internet.com/page-...ag-n-drop.html

each div containing an image has an id, and each image has a name, as in

<div id="h" style="position :absolute;left: 100;top:350;">
<img src=http://javascript.inte rnet.com/img/cards/hearts.gif name="h">
</div>

but I don't see where he references these id's and names in the JS code..

functions are declared with param 'e', but I don't see this param being
passed to the functions when they're called (called thus:
document.onmou sedown = MD;.. etc..)

I need to apply this to a div (which contains a table), but if I put the
same id and name to my <divas he has here for one of the images it
doesn't work..

The script you use is very old and likely comes from the browser war
era. It is not likely to work on some modern browsers.

Lasse Reichstein Nielsen who often posts here gave a good modern drag
script here about 2 years ago, and works on all of the modern browsers
on which I have tested it. You could likely find his post with a search
at Goggle. However, to save time, you might look at two of my pages at
http://cwdjr.net/test/newDrag.html and
http://www.cwdjr.net/test/picturePuzzle.html . You will see how the
script will work to drag images, text, and a division that contains 3
images.

thank you all again for your help, I'm still struggling with this one..

I checked out all links posted by respondents..

this one, http://cwdjr.net/test/newDrag.html, I found to be closest to
what I need, except for one little thing: when I first click on div to
move it, it jumps to the bottom of the page (sometimes way to the
bottom, far away from bottom of pg content, so that i have to scroll
down to get it..) this happens only the first time I click on div after
opening it.. (the div's 'visibility' css-property is set to 'hidden'
when pg opens, it's opened by user.. don't know if this makes a
difference..)

would appreciate some suggestions...

thank you very much...
Aug 13 '06 #7

maya wrote:
this one, http://cwdjr.net/test/newDrag.html, I found to be closest to
what I need, except for one little thing: when I first click on div to
move it, it jumps to the bottom of the page (sometimes way to the
bottom, far away from bottom of pg content, so that i have to scroll
down to get it..) this happens only the first time I click on div after
opening it.. (the div's 'visibility' css-property is set to 'hidden'
when pg opens, it's opened by user.. don't know if this makes a
difference..)

would appreciate some suggestions...
First, are you talking about the original URL you quote with only the
change of starting with visibility:hidd en for the division, or are you
talking about a very different page you made based on this?

If you are talking about the original, please tell us what browser and
OS you are using. The original works without "jumping" on divisions for
all recent browsers I have tested it with on Windows XP with all
updates, but I have not tested for a hidden division.

If you are talking about a page you made yourself, it will be difficult
to help you unless you can post a page that shows the problem, or at
least post the code that gives the problem, here. There likely are many
things that could cause your problem. Just for starters, make your
division visible and see if there is a problem. If this cures the
problem, you might then be able to cure your problem by using a visible
division with only one tiny thing such as a 1 px period in a paragraph
in it that is visible, and a picture or whatever you want hidden within
the division in another paragraph with a style associated with it so
you can make the paragraph hidden. It might go something like:

<div>
<p style="font-size:1px">.</p>
<p style="visibili ty:hidden"><img src="url" alt="whatever"> </p>
</div>

Or you could make the visible period the same color as the background.
If your background is white, then you would use.

<p style="color:#f fffff">.</p>

If I have a bit of free time soon, I might play with the original a bit
to see what happens with a hidden division.

Aug 13 '06 #8
cwdjrxyz wrote:
maya wrote:
>this one, http://cwdjr.net/test/newDrag.html, I found to be closest to
what I need, except for one little thing: when I first click on div to
move it, it jumps to the bottom of the page (sometimes way to the
bottom, far away from bottom of pg content, so that i have to scroll
down to get it..) this happens only the first time I click on div after
opening it.. (the div's 'visibility' css-property is set to 'hidden'
when pg opens, it's opened by user.. don't know if this makes a
difference.. )

would appreciate some suggestions...

First, are you talking about the original URL you quote with only the
change of starting with visibility:hidd en for the division, or are you
talking about a very different page you made based on this?

If you are talking about the original, please tell us what browser and
OS you are using. The original works without "jumping" on divisions for
all recent browsers I have tested it with on Windows XP with all
updates, but I have not tested for a hidden division.

If you are talking about a page you made yourself, it will be difficult
to help you unless you can post a page that shows the problem, or at
least post the code that gives the problem, here.

thank you very much for yr help.. I have posted pg here..
http://www.francesdelrio.com/dd/kt-90dd2.html

I thought problem might be related to the fact that div to be dragged is
positioned absolutely (since in the drag-n-drop function he has this
line, how = how || "relative"; ..) so I tried positioning it relatively
(http://www.francesdelrio.com/dd/kt-90dd2a.html) but same problem.. (but
I do need the div to be positioned absolutely because I need it to be
positioned above all other elements on the page (and as I understand it
z-Index property works only for absolutely-positioned divs..) once div
is open, if you drag it to the right, it has to fall above the
nav-buttons..)

I made link that opens div red so you can spot it more easily..

thank you very much...

Aug 13 '06 #9

maya wrote:
thank you very much for yr help.. I have posted pg here..
http://www.francesdelrio.com/dd/kt-90dd2.html

I thought problem might be related to the fact that div to be dragged is
positioned absolutely (since in the drag-n-drop function he has this
line, how = how || "relative"; ..) so I tried positioning it relatively
(http://www.francesdelrio.com/dd/kt-90dd2a.html) but same problem.. (but
I do need the div to be positioned absolutely because I need it to be
positioned above all other elements on the page (and as I understand it
z-Index property works only for absolutely-positioned divs..) once div
is open, if you drag it to the right, it has to fall above the
nav-buttons..)

I made link that opens div red so you can spot it more easily..
OK, I now see what is happening. My guess is that perhaps an onclick
action that opens the table for view is interacting in some strange way
with the onmousedown used for drag-and-drop for the division that
contains the table. Once the table appears and you click on it, it
jumps to the lower part of the page. But after that the drag-and-drop
works properly and you can move the table all over the page. I have not
been able to trace down the reason for this strange affair yet.
Hopefully the "Iron Scriptor", whoever that may be, will make an
appearance and explain to us what is going on :-).

I was able to do something else that might meet your needs, at least
until you can find out more about the above problem. I have a demo at
http://www.cwdjr.net/test/dragProblem.html . I have made comments where
changes are made. The demo page is very messy, because I did not link
to most of your images, etc.I made no attempt to check the bulk of your
code not related to the problem at hand. What I did was associate
onmouseover and onmouseoff with the red link that controls the table,
and I used control of visibility. If this is of any use to you, you may
want to reposition the table or red link a bit so the table does not
cover part of the link. IE6 seems to have a bit of a problem if you
move the cursor over the part of the red link that is covered by the
table, but it works normally just as for Firefox and Opera when you
move the cursor over the part of the red link not covered by the table.

Aug 15 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1179
by: Meikel | last post by:
Once I had drag and drop working in my Jtrees just implementing the AutoScroll-interface (with the methods from the example) worked for me. No extra registering was required. For drag and drop itself http://www.javaworld.com/javaworld/jw-03-1999/jw-03-dragndrop.html is still a good introduction.
1
1554
by: zbcong | last post by:
hello there are two ListViews with the SAME coloumns within one winform,i want to move the data from one ListView into other one,what is the simplest method? thank you!!
0
1018
by: Anjali | last post by:
Hi, I want to implement DragnDrop across th forms of the application. I am able to get some examples to implement DragnDrop across the controls in the same form but I have to implement that across the forms.. Any help on this is highly appreciated. Regards,
6
891
by: John E. Fox | last post by:
Dear All, I am running Access 97 and I suspect that drag and drop is not supported ( or at least I can't do it! ) Is this supported in any of the later Access versions? I don't particluarly want to upgrade as our system is fine but it would be nice to be able to drag and drop data between fields.
2
1175
by: Michael Maercker | last post by:
hi! i come from vb6 and am wondering: what happened to ole_drag/drop? and how can implement dragndrop from the explorer (or any other file list, i.e. winamp) into my listbox in c#? i've done it all in vb6; strange that it's so different in c#... i'm trying to figure it out just now and i sortta got stuck when i noticed that not even the mousecursor changes as i would expect it to, when i set
1
1724
by: thomasp | last post by:
Has anyone got some sample code to do drag and drop from one listbox to another listbox using VB.Net 2005. The below code works for draging and droping one at a time, but not for multiselected items. I tried setting up an array to capture the selected items and then move them with the dragndrop code, but after selecting the items when the user clicks on the items to drag them the selection goes back to one item. Also I have code for the...
3
3297
by: thomasp | last post by:
Has anyone got some sample code to do drag and drop from one listbox to another listbox using VB.Net 2005. The below code works for draging and droping one at a time, but not for multiselected items. I tried setting up an array to capture the selected items and then move them with the dragndrop code, but after selecting the items when the user clicks on the items to drag them the selection goes back to one item. Also I have code for the...
2
1172
by: Sam | last post by:
Hi, In my form I have two ToolStripPanels (TSP), one docked on the left, the other docked on the right. Each of those TSP contains a ToolSrip control. I would like to allow the ToolStrips to move on their respective TSP they belong to, but prevent dragndrop of ToolStrips from one TSP to the other. How can I do that?
4
2555
by: Full NameEntry | last post by:
Hi all, I'm new to csharp... learning it by muddling my way though examples. In my current example, I'm trying to make a form with a bunch of listboxes that have drag and drop enabled amongst them... I found an example online in the form of a DragNDrop.cs file that I've included in my project (attached below).
5
13768
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with drag&drop on the same page (which was not possible). Now i´ve a new concept of the script, more object oriented. I´ve also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.