我想用Jquery淡出表格中的所有圖像。用Jquery褪去所有圖像
以下似乎不起作用。可能是語法錯誤?
$(function() {
$('#myTable img').each(function(index) {
$(this).fadeOut('slow', function() {
// Animation complete.
});
});
});
我想用Jquery淡出表格中的所有圖像。用Jquery褪去所有圖像
以下似乎不起作用。可能是語法錯誤?
$(function() {
$('#myTable img').each(function(index) {
$(this).fadeOut('slow', function() {
// Animation complete.
});
});
});
你只需要做到這一點:
$(function() {
$('#myTable img').fadeOut('slow', function() {
// Animation complete.
});
});
您不必使用each
方法。
如果你想使用each
方法,請執行下列操作
$(function() {
$('#myTable img').each(function(index,e) {
$(e).fadeOut('slow', function() {
// Animation complete.
});
});
});
的e
將引用當前圖像。
適合我。也許你的ID是錯的:http://jsfiddle.net/jomanlk/y9zCK/ – JohnP
我有一個錯誤之上。謝謝它的工作 – james