|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
buggy click and drag
well it has been a while, I have been focusing on my Java so haven't been here for a little bit.
Anyways, I am pushing the limits again :-) check out this page http://www.hysteriaweb.net/index.php?page=999&width=1004&height=591 try to move the item around, it works but only most of the time. when I put an alert up when the mouse down is activated it showed that it does not even register the event. so it is not the code is it just a limitation of the browser or is it just my computer? thanks |
|
#2
|
|||||
|
|||||
|
RE: buggy click and drag
Looks to me like you just downloaded some DHTML lib and are expecting us to dig through all of it; that will probably cost me hours because it's so bloated...
I'll give you a very simple example on how to move an element around (which also works in NS6+ and Mozilla): php Code:
(put it in PHP tags for readability) |
|
#3
|
|||
|
|||
|
RE: buggy click and drag
thanks a bunch, actaully wrote most of that from scratch!!! :-)
I will give your solution a whirl. Thanks |
|
#4
|
|||
|
|||
|
RE: buggy click and drag
the reason it looked bloated is because I combined the move with the resize op too. then I kinda left a chunk of the resize stuff in there because I was unsure if I would use it or not.
I will strip that out, clean up the code and take it from there. the think I do not like too much on your example, which is very cool. is that you have a lot of extra stuff like an init and the fact you need to set up the items that are to move in there. I am adding this to a builder and I wanted to try to avoid adding more stuff in that needed to be set. This maybe why I am having issues, I may need to do that the use of onselectstart is interesting. never thought to do it like that. let me take another look and get back to you. thanks again for the help |
|
#5
|
|||
|
|||
|
RE: buggy click and drag
down to this and it still does it. I that it normally always skips the first one and I don't know why, any ideas?
var ob = null; var over = false; var X = 0; var Y = 0; function MD(e) { if (over) { ob = event.srcElement.parentElement; X=event.offsetX; Y=event.offsetY; } } function MM(e) { if (ob) { ob.style.pixelLeft = event.x - X - document.body.scrollLeft; ob.style.pixelTop = event.y - Y - document.body.scrollTop; } return false; } function MU(e) { ob = null; } document.onmousedown = MD; document.onmousemove = MM; document.onmouseup = MU; |
|
#6
|
|||
|
|||
|
RE: buggy click and drag
ps I use the parent object because I am moving images inside a div.
|
|
#7
|
|||
|
|||
|
RE: buggy click and drag
more news, it seems like seeting the over to true is not registering, which means it may because just a little slow some times.
your way to trigger the move is a lot better but like I said I wish to avoid an init if possible, I will work on this |
|
#8
|
|||
|
|||
|
RE: buggy click and drag
think I am going to try moving the mouse event triggers to the object.
looks like your select just kinda ignores so you have the event trigger on the object, which I could simply include into the reg code. |
|
#9
|
|||
|
|||
|
RE: buggy click and drag
I have seen more strange behaviour when using event-triggers in an area-map. Thereby the area with the code to set the over variable is quite small; maybe it's a combination of these two problems.
|
|
#10
|
|||
|
|||
|
RE: buggy click and drag
having issues calling the mousedown from the event trigger being on the div (I have also tried many combinatiopns on the img itself. mo luck
http://www.hysteriaweb.net/stuff/temp/moving.html how do I put the call for the mousedown trigger on the div? I have tried onMouseDown=MD; onMouseDown="MD(e);" onMouseDown="function(e) { MD(e); }" nothing seems to work, the MD does not get called, in the second example I get an error saying e does not exist. what am I missing here? thanks |
|
#11
|
|||
|
|||
|
RE: buggy click and drag
The document.onmousedown=MD; is correct
I found that the following: ob = event.srcElement.parentElement is actually referring to the <MAP> instead of the <DIV>. When I changed it to: ob = event.srcElement.parentElement.parentElement; I was able to drag the picture around when clicking it in the upperleft corner |
|
#12
|
|||
|
|||
|
RE: buggy click and drag
ok, when I don't have the extra parent bit in there it works MOST of the time, when I do it flatly does not work.
I think that the is the timing of the setting of the over event flagger, the event gets captured but the over flag is not set at that time. it works MOST of the time but it never works right off the bat and then from time to time it throws a fit and refuses to do it. that is why I wanted to get rid of the document.onmousedown = MD and replace it with one on the actual div, can this be inline or not? what is the syntax to put it inline? thanks |
|
#13
|
|||
|
|||
|
RE: buggy click and drag
http://www.hysteriaweb.net/stuff/temp/moving.html
check this out now, I have added 2 different form boxes the first shows 'yup' when the event gets triggered then if the over is set then the second box also show yup, when the up even is triggered both get reset to nope. from this I can see that when it does not move the over is not set BUT the event is triggered. suggestions. thanks
|