Hello together,
this is my first time posting here, maybe I should introduce myself; my name is David Navratil - Dave will do - and I am working on my final project for my studies at a web programming school.
First off here is the piece that makes me go wild:
http://www.mobil.org/photograph/test.html
There are 3 boxes at the left. When you click "testtest" in the top, you should be able to drag the first box from top. The second box should be draggable normally and so should be number 3.
You can drop the boxes into the big gray box at the right. I know itīs not really pretty, but that makes it simple I hope.
I wrote my own Drag & Drop classes for this, which you can find here:
http://www.mobil.org/photograph/js/dragdrop.js
Now the problem:
Everything works fine (there are actually some minor problems, but nothing problematic) apart from one thing: when trying to drag box nr. 3 in Internet Explorer (my version is 7.0.6001.18000 on Vista, if that helps), it hangs itself up after a small amount of movement. After releasing the mouse button, the dragging doesnīt stop, in fact it begins to work at that moment.
The reason:
I found out why it behaves this way, but I canīt figure out, how to solve the problem. What happens at the moment I click the 3rd box is: the onmousemove-Event stops working. Same happens to the onmouseup-Event, which is why the dragging doesnt drop :) after releasing the mouse-button.
The line for the event is 84 in dragdrop.js:
window.document.onmousemove = this.mousepos;
This happens only with box nr.3, because, as I figured, it contains an img-tag. When using a trigger for the Drag & Drop, which is not an image, like text, for example, or a color-filled div, it works like a charm.
------------------------------
SO THE PROBLEM FOR ME IS :
------------------------------
When pushing a mousebutton directly over an img-tag, events stop firing until I release the mousebutton.
I also tried: window.document.attachEvent("onmousemove",this.mou sepos);
and I also tried leaving the "window." away. It wonīt work. There are also no styles or special treatments for img-tags in this testpage, which could be the reason, everything is inline.
I have been searching about this for last 5 hours and to be honest, I donīt even really know how to call this problem, so I have trouble finding anything on the net.
Hope you people here like having some fun with these things as I do; I just canīt help myself this time.
Before I forget: donīt suggest using frameworks please, I only trust my own code!; I am one of the crazy people.
Best Regards,
Dave