我希望在懸停時在div內顯示一些按鈕。元素正在用鼠標懸停在剪輯div的元素
例here
// HTML
<div id="overdiv">
<p>Move your mouse several times on this text to see the bug</p>
<input type="button" value="hello" class="elements"/>
</div>
// CSS
#overdiv {background:#CCC;border:1px solid #FFF;width:300px;height:150px;}
.elements {display:none;}
// JS
$('#overdiv').mouseover(function(){$('.elements').fadeIn();}).mouseout(function(){$('.elements').fadeOut();});
它的工作原理,但在鼠標懸停在其它元件邊div,然後我的按鈕出現並消失在循環中。 (我只用Chrome測試過)
那麼,如何讓按鈕出現一次,而鼠標是在div內,並且一旦消失,而鼠標不在使用?
完美!非常感謝 ! – Valky 2012-08-08 13:04:03