From: <do...@cr...> - 2005-08-12 14:32:07
|
Okay.. instead of inserting the background layer the way you are now, What I do is have a div in my html at the location i want my layer, then onload, i use the Inline extension to pull out the position of the relative div in the document, and position my layer accordingly. I can't help but wonder if adding the layer to the dynapi.document (which inserts it in the browser's DOM) then inserting it a second time with your inset call.. try using the FireFox dom inspector (i think it's included, but you may want to DL it from the FF extensions page) once you page is loaded, you can browse through the document's objects to see if your layer is there twice. cheers P.S. Sample code that exhibits the error would be great.. make it much easier to deterine the issue at hand :-) Leif W <war...@us...> said: > > From: "Leif W" <war...@us...> > > Sent: 2005 August 11 Thursday 14:18 > > > >> From: "Bob Jamison" <bob...@gr...> > >> Sent: 2005 August 11 Thursday 13:41 > > > > I think I understand now. Click somewhere on bg1 and have lyr1 move > > there. Centered lyr1 around the point you clicked? And then what > > happens? Continue to drag without lifting the button and clicking > > lyr1 to initiate a drag event? I've never done that, but I would > > guess I'd add an onclick event listener to bg1, and have that handler > > move bg1, centered, and attempt to invoke a drag event on bg1. I'd > > probably have a delay between the move and the drag, maybe half second > > or quarter second. > > Well, I haven't had the big breakthrough I was hoping for, but I did > make some observations. > > 1) Onclick you can think of like two events: onmousedown and onmouseup. > Therefore, a click event does not happen until the mouse comes back up. > So you can't use a single click to pull a layer to the mouse and drag, > if you use onclick event. So, use onmousedown event. Which leads to > the second observation. > > 2) I think I see now what you might be experiencing. When setting up a > background layer, adding to that a layer with a photograph, and adding > to that a layer that you move around (fetch and drag), then there's a > problem. The onmousedown event is passing the X and Y coordinates +8 or > +9 or so. The upper left corner of the fetched layer stops to the 8 or > 9 pixels to the lower right of the cursor. Therefore you can never > connect with a drag event. If I remove the relative insert later in the > document, the upper left corner of the fetched layer comes to a stop > precisely underneath the mouse cursor. > > It's hard to know the intent without having a precise yet simplified > example of how the code needs to fit together in the end. I can only > guess something like you'll have some text or images or other layers, > then you'll want to relatively insert this background layer, with it's > photo and it's fetchable/draggable layer. You won't know ahead of time > how to precisely position the layer on the page, so everything must be > done relative to the background layer. Maybe there's another way to do > things? I'm still learning myself. I definitely would like to > understand where the offset is coming from. I might have a hunch about > some thing. Anyways I'll submit a bug with my above observations so it > will not be forgotten. > > Leif > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-help > -- |