Because the Droppable has a higher z-index.
It's not that the Draggable isn't draggable anymore, it's that the
click event is going to the Droppable (which is on "top"), and no
further.
Add the following CSS, and try it again:
.draggables {
border: 1px solid green;
z-index: 10;
}
.droppables{
padding: 3em;
border: 2px solid red;
z-index: 1;
}
(I think you'll also find your draggables are bigger than you may
have intended.)
TAG
On Apr 12, 2007, at 5:59 AM, ben wrote:
>
> Using the code below (with prototype v1.5.0 and scriptaculous v1.7.0)
> - when I drag one of the draggables onto a droppable, it stops being a
> draggable.
>
> I don't want that. I want it to remain draggable until I say so.
>
> Am I failing to understand something fundamental, or is this a simple
> fix to my code?
>
> <div id="d1" class="draggables">
> <span class="draghandle">drag me</span>
> <br/>I am draggable
> </div>
>
> <div id="d2" class="draggables">
> <span class="draghandle">drag me too</span>
> <br/>I am draggable
> </div>
>
> <div id="drop1" class="droppables" style="float:left;"></div>
> <div id="drop2" class="droppables" style="float:right;"></div>
> <br style="clear:both;"/>
>
> <div id="dropstatus" ></div>
>
> <script type="text/javascript">
>
> new Draggable('d1',{handle:'draghandle', snap:[10,10]});
> new Draggable('d2',{handle:'draghandle', snap:[10,10]});
>
> Droppables.add('drop1', {
> onDrop: function(element){
> $('dropstatus').innerHTML = 'Dropped ' + element.id + '
> on drop1.';
> }
> });
> Droppables.add('drop2', {
> onDrop: function(element){
> $('dropstatus').innerHTML = 'Dropped ' + element.id + '
> on drop2.';
> }
> });
> </script>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---