javascript - increase size of mouseleave area -
<http://jsfiddle.net/rbj9r/1504/>
i mouseleave trigger area increase in size include image original mouseenter area (gray box). user able still see image if mouse on image area.
thanks!
#slender-trigger { background-color: #ccc; height: 100px; width: 120px; margin-left: 0px; margin-top: 50px; position: absolute; } #slender { font-family: 'strait', sans-serif; height: 400px; width: 400px; border: thin dotted #f00; position: absolute; margin-top: 50px; margin-left: 120px; display: none; } <div class="purchasing-tips"> <div id="slender-trigger">nnnn</div> <div id="slender" style="background-image:url(http://lorempixel.com/120/100/people); height: 100px; width: 120px; border: 1px solid black;">sadfasdf</div> </div> $("#slender-trigger").on("mouseenter", function() { $("#slender").show(); }).on("mouseleave", function() { $("#slender").hide(); });
simply write way:
$("#slender-trigger, #slender").on("mouseenter", function() { $("#slender").show(); }).on("mouseleave", function() { $("#slender").hide(); });
Comments
Post a Comment