views:

22

answers:

1

In this question, draggables are created on the fly, when the mouse enters the element to drag.

I'd like to do the same kind of thing, but with droppables : decides whether to make the element droppable only when the dragged element arrives over it. I'm sure it's possible but after a bit of research, I couldn't make it.

I tried things like this, but failed:

jQuery.fn.liveDroppable = function (opts) {
    this.live("mouseover", function() {
        if (!$(this).data("livedropinit")) {
            $(this).data("livedropinit", true).droppable(opts);
            $(this).trigger('dropover');
        }
    });
};
A: 

Would this work for you? It's the .hover(); function. Not sure if you've tried it yet. http://api.jquery.com/hover/

Micharch54
You could probably simply do the .hover() and append the html or something so that it has the hoverable tag. You might have to bind the element using something like livequery, not sure.
Micharch54