私は私のjsでこれを持っています:
$(function(){
$('.slide:nth-child(11) .layout-100:first-child').click(function(){
$('.slide:nth-child(11) .layout-100:first-child').fadeOut('slow');
$('.slide:nth-child(11) .layout-100:nth-child(2)').fadeIn('slow');
});
});
$(function(){
$('.slide:nth-child(11) .layout-100:nth-child(2)').click(function(){
$('.slide:nth-child(11) .layout-100:nth-child(2)').fadeOut('slow');
$('.slide:nth-child(11) .layout-100:nth-child(3)').fadeIn('slow');
});
});
...等々。
クリック機能で切り替えたい画像が複数あります。しかし、私が今それを書き留めている方法は、多くのコードです。これを1つの関数に入れる方法はありますか?