On Tue, May 23, 2006 at 02:54:43PM -0400, Martinez, Andrew wrote:
# Close. Take out your zIndex option and it should automatically revert for you.
The zIndex used while dragging by defaults is 1000 and after you release it
should drop back to what it was before.
#
# The reason it drops behind the other is because of the way it is attached to
the DOM. zIndices are relatative to the parent node only. Thus if you have two
items under the same parent node with the same zIndex the one that was added
last is shown on top. If you want to show it behind the other, set its original
zIndex lower than the other before the drag starts.
#
# new Draggable(''g-'' +
G.cg,{handle:''dragbutton'',revert:function(el){setCurrent(el)}});
Thanks for the reply and sorry for my delay in responding.
I removed the zindex option and it still drops behind. All of the
sibling nodes are starting with the same (default) z-Index. Do I
need to find all of the siblings and lower their z-Index when the
drag starts?
Also, I noticed that despite having an image with the class
''dragbutton'', clicking virtually anywhere on the div (that
doesn''t
have another click event handler) will allow me to drag it... is that
the expected behavior?
#
# -Andrew Martinez
#
# -----Original Message-----
# From:
rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]
On Behalf Of Sam Rowe
# Sent: Tuesday, May 23, 2006 2:48 PM
# To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
# Subject: [Rails-spinoffs] Draggables and z-index
#
#
# I''m using Draggagle on a couple of divs and when I drop the first
one, it''ll
# always drop behind (in terms of z-index) the second one. I even added a
# revert function to add a CSS class to the div that should raise it up, but I
# think the style.zIndex is "winning."
#
# Looking at the code, it seems like the zIndex stuff is set *after*
# the revert function is called... is there any way to do what I''m
# trying to do?
#
# Here''s my call to Draggable just in case it''s obviously
stupid:
#
# new Draggable(''g-'' +
G.cg,{handle:''dragbutton'',revert:function(el){setCurrent(el)},zIndex:false});
#
# Thanks!
# _______________________________________________
# Rails-spinoffs mailing list
# Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
# http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
# _______________________________________________
# Rails-spinoffs mailing list
# Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
# http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs