Don't think so - just tried it and now nothing drops :)
Basically the problem is that I start with a droppable that will
accept anything and only once one element has been dropped on does the
accept have to change so only elements of that same class can be
dropped in future.
So this for the initial droppable doesn't work:
Droppables.add('header-' + this.id, {accept: '.anything', onDrop:
this.dropElement.bind(this)});
But this (my original code) does work:
Droppables.add('header-' + this.id, {accept: 'anything', onDrop:
this.dropElement.bind(this)});
The only difference is the addition of the '.' and that's what breaks
it.
There's also an error in your example - Draggable doesn't have an
accept param.
On Apr 28, 8:03 am, Guillaume Lepicard <[email protected]>
wrote:
> hi,
>
> as far as i can remember, the accept option has to be in a selector syntax:
> try
> new Draggable ('draggable', {revert: 'failure', accept: '.dropme'});
> or
> Droppables.add(audience-element-0, {accept: '.Social', onDrop:
> this.dropElement});
>
>
>
> On Tue, Apr 27, 2010 at 10:47 PM, Jangla <[email protected]> wrote:
> > If I have this code:
>
> > <div id="draggable" class="dodrop dropme">drag me</div>
> > <div id="droppable">drop here</div>
>
> > <script>
> > new Draggable ('draggable', {revert: 'failure', accept: 'dropme'});
> > Droppables.add ('droppable');
> > </script>
>
> > I would expect the dropped element to be accpeted by the droppable but
> > it's not for some reason. Can anyone help me out on this? I have some
> > rather more complex code that results in a div element with the class
> > names "audience-element" and "Social" like so:
>
> > <div id="audience-element-0" class="audience-element Social"
> > style="top: 0pt; left: 0pt; z-index: 0;">
>
> > As far as I can tell, if I define my droppable like so:
>
> > Droppables.add(audience-element-0, {accept: 'Social', onDrop:
> > this.dropElement});
>
> > ... then this should successfully drop onto the target element and
> > stay there....but it doesn't :(
>
> > Help!!! :)
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Prototype & script.aculo.us" group.
> > To post to this group, send email to
> > [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<prototype-scriptaculous%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" 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
> athttp://groups.google.com/group/prototype-scriptaculous?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en.