テーブル内のに画像を含むjQueryコードを挿入しようとして<td>
いますが、画像がテーブルの境界外にあります。私は多くの方法を試しましたが、うまくいきませんでした。
Javscript
<script type="text/javascript">
$(document).ready(function() {
var $elements = $('#picOne, #picTwo, #picTree, #picFour');
function anim_loop(index) {
$elements.eq(index).fadeIn(4000, function() {
var $self = $(this);
setTimeout(function() {
$self.fadeOut(4000);
anim_loop((index + 1) % $elements.length);
}, 6000);
});
}
anim_loop(0); // start with the first element
});
</script>
HTML
<table align="center" width="975" border="1">
<tr>
<td>
<div id="picOne"><img src="pic1.jpg" /></div>
<div id="picTwo"><img src="pic1b.jpg" /></div>
<div id="picTree"><img src="2b.jpg" /></div>
<div id="picFour"><img src="2.jpg" /></div>
</td>
</tr>
</table>
</body>
</html>
どうすれば修正できますか?