0
我試圖在div
淡入時更改background-color
,但下面的代碼無法使用。當div淡入時更改背景顏色
相反,它只fadeOut
並沒有任何顯示,當我試圖click
到fadeIn.
$('#divbutton').toggle(function(){
$('#divbutton').text('Show');
$('#message').fadeOut('1000');
} ,
function(){
$('#divbutton').text('Hide');
$('#message').$this.css('background-color', 'red').fadeIn('1000');
}
);
你想用'$('#message')。$ this'實現什麼? – undefined 2013-02-23 04:04:37
請正確縮進您的代碼 – martriay 2013-02-23 04:04:40
可能要刪除'$ this'。 '$(this)'會引用我相信的'#divbutton'。你沒有得到控制檯中的語法錯誤?你一定是。/ – Leeish 2013-02-23 04:07:40