HI,
Thanks for the replies. I don't think i can use .each in this
instance. droppableZones is being fed to my function right at the top
and when i try and use each i get droppableZones.each is not a
function error. See the code below.
Also, if i just use a normal for loop, as below, i never get in to
the inner function...i never get the alert(dropZoneCount) in the code
below back. I need to keep the dropZoneCount so i can tell which
dropzone the drop has been made in.
Any ideas?
function dragAndDrop(droppableZones) {
var count = 0;
var alldrags = $$('.dragMe');
var alldragslength = alldrags.length;
alldrags.each(function(w) {
new Draggable(w, { zindex: false, revert:
true });
})
for(var dropZoneCount = 1; dropZoneCount <
droppableZones; ++ dropZoneCount) {
Droppables.add('droppable_' + dropZoneCount,
{ accept: 'dragMe', hoverclass: 'dropallowed', onDrop : (function(i) {
return function() {
alert(dropZoneCount);
count ++;
var newCopy = new Element('div', { 'id' :
i.id, 'class' : 'de_small' }).update('this is a copied element');
$('droppable_' +
dropZoneCount).appendChild(newCopy);
obj.remove();
if(count == alldragslength) {
evaluate();
}
}
})
})
}
}
On May 19, 1:49 pm, jdalton <[EMAIL PROTECTED]> wrote:
> I still get bit by this every once in a while :)
>
> - JDD
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---