0
我有以下代碼來顯示帖子的段落,鼠標懸停在H1標籤之後,但我想防止鼠標通過時顯示段落對H1標籤的抨擊(他們在一個頁面上有幾個),因此用戶必須在H1標籤上停留一段時間才能顯示de post段落。另一方面,如果用戶推出H1但翻過P標籤,則該段落不會切換。jQuery 1.4.2懸停方法:鼠標懸停並將鼠標移出問題
這是jQuery的代碼,我現在寫的:
$("div#postContainer p").hide(); //By default, we hide the post paragraph
$("div#postContainer h1").hover(function() {
$(this).removeClass("less").addClass("more");
$(this).next("p").animate({opacity:"show",height:"toggle"}, "slow");
}, function() {
$("div#postContainer h1 span").removeClass("more").addClass("less");
$(this).next("p").animate({opacity:"hide",height:"toggle"}, "normal");
});
如果有人知道一個解決方案,我非常感激。
它不切換段落顯示。 – betacar 2010-04-13 18:28:37