javascript - Automatically showing div on mouseover -
javascript - Automatically showing div on mouseover -
this simple problem i'm having, life of me, can't seem figure out. if of help me this, much obliged.
i'm using jquery create menu appear when user hovers on div. menu displayed on top left of div. got work, when seek click on menu item of div appeared, div disappears again, because mouse technically not on div, on menu.
in illustration below, "#blockmenu" menu dynamically appears. fade current div ($this)) out bit, emphasize menu well.
i utilize next code create happen:
$("div.editable").hover(function () { $(this).fadeto(500, 0.25); $('#menu').css("position", "absolute"); $("#menu").css("top", $(this).offset().top); $("#menu").css("left", $(this).offset().left); $("#menu").css("zindex", "10000"); $('#menu').show(); }, function (e) { // on mouseout $(this).fadeto(500, 1); $("#menu").hide(); }); i want menu disappear when cursor leaves div, while div remains faded out when cursor on menu. when cursor leaves menu , div @ same time, div should fade in , menu should disappear.
does have thought of how edit code create work correctly?
thank much help can give me.
just utilize :hover pseudo class, that's help situation. you'll lose animation effects, sure create things easier, , take javascript out of picture
javascript jquery
Comments
Post a Comment