K
Kevin Blount
I'm playing with dragable <DIV>s, being inspired by google.com/ig,
where you can move items on the page around and have items you move
over change position if necessary.
I have 3 div's setup, one for each dragable item (boxes about
100x150px), inside another div that sets up a border.
my script is instigated by an onMouseOver event and works great for
moving items, setting the opacity, etc. The only trouble is (and I
guess I should have expected this) is that when I'm dragging one div,
the onMouseOver events for the other 2 divs are not initialized. In
retrospect that's probably a good thing, or I'd end up dragging
everything at the same time.
What I'm looking for is an idea where to go next in order to find out
what I'm dragging a div over. I purposely didn't include any code as
I'm really looking for just hints rather than solutions, as this
project is very much a learning excercise for myself, and I've already
cheated enough by downloading dom-drag.js as the base code.
any ideas how I can find out what I'm dragging over? My thoughts were
listeners (though I don't know much about them but they seemed to make
sense here) or not worrying about what I'm over, but more where I am in
the list and then work out if something needs to be move or not (seems
cumbersome and potentially a resource hog while I check mouse movements
and positions while dragging)
any hints and/or tips would be appreciated.
where you can move items on the page around and have items you move
over change position if necessary.
I have 3 div's setup, one for each dragable item (boxes about
100x150px), inside another div that sets up a border.
my script is instigated by an onMouseOver event and works great for
moving items, setting the opacity, etc. The only trouble is (and I
guess I should have expected this) is that when I'm dragging one div,
the onMouseOver events for the other 2 divs are not initialized. In
retrospect that's probably a good thing, or I'd end up dragging
everything at the same time.
What I'm looking for is an idea where to go next in order to find out
what I'm dragging a div over. I purposely didn't include any code as
I'm really looking for just hints rather than solutions, as this
project is very much a learning excercise for myself, and I've already
cheated enough by downloading dom-drag.js as the base code.
any ideas how I can find out what I'm dragging over? My thoughts were
listeners (though I don't know much about them but they seemed to make
sense here) or not worrying about what I'm over, but more where I am in
the list and then work out if something needs to be move or not (seems
cumbersome and potentially a resource hog while I check mouse movements
and positions while dragging)
any hints and/or tips would be appreciated.