如何通過單擊圖像執行以下代碼?添加代碼以單擊事件
$('#container').animate({'opacity': 0}, 1000, function() {
$(this).text('new text');
}).animate({'opacity': 1}, 1000);
如何通過單擊圖像執行以下代碼?添加代碼以單擊事件
$('#container').animate({'opacity': 0}, 1000, function() {
$(this).text('new text');
}).animate({'opacity': 1}, 1000);
$('yourimageselector').click(function() {
$('#container').animate({
'opacity': 0
}, 1000, function() {
$(this).text('new text');
}).animate({
'opacity': 1
}, 1000);
});
通過'$(圖像)。在包裹它(「點擊」,函數(){'也許 – 2013-03-14 16:38:35