I applied a quick and dirty hack to the "onEmptyHover"-function to get
rid of the flickering when using dropOnEmpty
-->  onEmptyHover: function(element, dropon, overlap) {
(it's in the dragdrop.js-file)

There is an if-statement in this function which has to be altered:

the original line in Version 1.8.1 of scriptaculous reads:
-->   " if(!Element.isParent(dropon, element)) {"

changing this line to
-->   " if((!Element.isParent(dropon, element)) &&
(Element.empty(dropon))) {"
turned the flickering off.

This can only be used, in case there are no other html-elements in the
empty "Drop-On"-Element. Otherwise it remains undroppable.

The reason for the flickering is (as far as I figured it out) the
Element.isParent(dropon,element) returning false, even when the
dragged item is still within it's original parent. By checking wether
the underlying Droppable is really empty (and therefore not the home-
droppable, where the dragged item came from), we can assure that the
onEmptyHover-Code is not executed falsely.

This is only a quick and dirty hack, I did not completely analyze the
scriptaculous-code, so it might not work for everyone.


On Oct 10, 1:15 pm, Sumita <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a horizontal sortable with three images arranged horizontally
> in a div (images in a div tag). The moment I introduce
> dropOnEmpty:true, and I try to drop an image from another sortable,
> there is a flickering and the sortable is creates its own drop
> position.
> Can you suggest a solution??

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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to