我是初學者學習jQuery和問題說:jQuery的 - 將CSS應用於第一款
添加一個jQuery事件監聽風格的第一款當鼠標光標是在它爲褐色,大膽的風格和下劃線。
我想這一點:
$(document).ready(function() {
$("p").first().hover(
function() {
(this).css('color','brown');
(this).css('font-weight','bold');
(this).css('text-decoration','underline');
},
function() {
(this).css('color','black');
(this).css('font-weight','normal');
(this).css('text-decoration','none');
}
);
});
但它不工作。所有的p標籤都包裹在不同的div標籤中,這是否有所作爲?通過「第一段」,我認爲這意味着頁面上的第一段。
似乎沒什麼問題http://jsfiddle.net/arunpjohny/m8ZSa/1/ – 2013-05-06 03:08:15
有一種類型,你缺少的'('$'跡象這個)' – 2013-05-06 03:08:45