我試圖在內容上淡出當鼠標移動(類似於谷歌主頁的方式做),但我想阻止這種行爲,如果將鼠標光標懸停在特定的分區。淡入內容時鼠標移動並沒有懸停在一個div
這裏的基礎知識:
$("html").hover(function() {
$("#navigation, #content").fadeIn("slow");
});
這成功地淡入內容。我一直在嘗試檢測遊標何時位於特定元素上,但無效。這是我有:
$("html").one("mousemove", function() {
if (mouseover == false) {
$("#navigation, #content").fadeIn("slow");
}
});
var mouseover = false;
$('#hero').mouseenter(function() {
mouseover = true;
}).mouseleave(function() {
mouseover = false;
});
可能有更好的方法來做到這一點比我這裏?
謝謝你會看看它。我用一個相當笨拙的功能解決了這個問題,我即將發佈。 – Craig 2011-01-14 20:20:50