views:

35

answers:

1

Hi,

I want to display a properties div on click event of another div named abc, which has been dropped using jquery UI droppable. I could show the properties div by binding an event with the abc div, but I want to hide the properties div when the div abc loses its focus.

Thanks in advance

A: 

Hi,

you can indeed bind the click event and then use the focusout() function inside.

like :

(#abc).live('click',function() {

......
(#abc).focusout(function() { .....
});

});

If I missed some subtility please tell me ;)

Michael Lumbroso
Did not work :(...I have added following code inside drop:$(".textElementClass").live('click', function() { $(".textBar").css({'display':'block'}); }); $(".textElementClass").focusout( function() { $(".textBar").css({'display':'none'}); })
KutePHP
maybe the droppable protects the click event, try to use dblclick event instead. If it still doesn't work, I'll have a closer look at it.
Michael Lumbroso
Hi Michel,I added the live out of drop and it worked. The class .textElementClass is actually a paragraph. and I tried to hide properties div using focusout, but it is not working.At http://api.jquery.com/focusout/, I found it is used with inputs. Does it mean, this will not work with elements other than inputs ?What is option to do this then?
KutePHP
I got why it is not working with my elements. focus works only with links and form elements....is there any other way to handle this ?
KutePHP