[jQuery] mouseover/out events
Hi,
I have really stuck with this one. :) I have divs that contain html
text. What I need is when I move mouse over that div link is displayed
to edit content. I have such code:
$J('div.editable_content').mouseover(function(event) {
$J(event.target).css("border", "1px solid black");
$J('div.content_edit', event.target).show();
return true;
}).mouseout(function(event) {
$J(event.target).css("border", "0px");
setTimeout(function(){
$J('div.content_edit', event.target).hide();
}, 2000);
return true;
});
But the problem is that if I move mouse on content that is inside this
div (for example image) than mouseout event is triggered. One solution
would be adding this event to all elements inside that div. What
selector should I use to select all elements inside div
("div.editable_content *" and "div.editable_content > *" does not seem
to work for this problem)? Any better solutions how to do this without
attaching events to all elements?
Thanks in advance,
Lauris