Hello,

I still have some problems with DragnDrop:
I have a problem with the parameters of a Draggable


        new Draggable( 'test', {
                onEnd: function( element, target )
                {
                        alert( elelemt );
                        alert( element.id );
                        alert( JSON.stringify( element ) );
                }
        });

When the drag ends I get this messages:
1. Alert: [object Object]
2. Alert: undefined
3. Alert:
{"element":{"_madePositioned":true,"_eventID":2,"_opacity":1},"handle": 
{"_madePositioned":true,"_eventID":2,"_opacity":1},"options": 
{"handle":false,"zindex": 
1000,"revert":false,"quiet":false,"scroll":false,"scrollSensitivity": 
20,"scrollSpeed":15,"snap":false,"delay": 
0},"dragging":false,"offset":"[3, 13]","delta":"[0, 0]","originalZ": 
1000}


Now I have a Droppable:

        Droppables.add( 'testDrop' , {
                onDrop: function( element, target, event )
                {
                        alert( elelemt );
                        alert( element.id );
                        alert( JSON.stringify( element ) );
                }
        });

When I Drag the Draggable Element on the Droppable I get this Messages:
1.Alert: [object HTMLImageElement]
2. Alert: Test
3. Alert: {"_madePositioned":true,"_eventID":2,"_opacity":1}

I would expect, that the elements i´n both situations are the same.  
But they aren't.
I think the second situation is correct....

Where is my error here?

Thanks for your Help,
Stefan Sturm


Am 30.05.2008 um 11:46 schrieb Stefan Sturm:

> Hello,
>
> I'm making my first steps with prototype and scriptaculous.
> I'm playing around with drag and drop.
>
> What I try to do:
> I have some Draggables and some Droppables. You can drag each
> Draggables to each Droppables.
> When I drop a Draggables I want to center the Draggables inside the
> Droppable.
>
> And here I get my first problems:-(
>
> I use this code:
>       Droppables.add( 'pos_2' , {
>               onDrop: function( element, target )
>               {
>                       target.highlight();
>                       element.absolutize();
>                       new Effect.Move( element, { x: target.offsetLeft, y:
> target.offsetTop, mode: 'absolute' } );
>               }
>       });
>
> When I do this, it seams to work fine, but:
> After the "element.absolutize();" the element is moved behind the
> target. It seams that the z-index changed. I tried to change the z-
> index on the element, but without luck.
> The problem is, that after the drop, I can't drag the element, because
> it is behind the target.
>
> Where is my error? Perhaps someone can help me.
>
> Thanks and greetings,
> Stefan Sturm
>
> PS: I'm using Firefox 3 RC 1 on Mac OSX 10.5.3
>


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to