大きな画像と多数のサムネイルが表示されているページがあります。サムネイルの上にマウスを置くと、メイン画像がマウスをロールオーバーしたばかりの画像に変わります。問題は、サムネイルが多いほど、コードが繰り返されることです。どうすればそれを減らすことができますか?
Jqueryコードは次のとおりです。
<script type="text/javascript">  
    $('#thumb1')
.mouseover(function(){  
$('#big_img').fadeOut('slow', function(){  
$('#big_img').attr('src', '0001.jpg');  
$('#big_img').fadeIn('slow');  
            });  
        });  
    $('#thumb2')  
        .mouseover(function(){  
            $('#big_img').fadeOut('slow', function(){  
                $('#big_img').attr('src', 'p_0002.jpg');  
                $('#big_img').fadeIn('slow');  
            });  
        });  
     $('#thumb3')  
        .mouseover(function(){  
    $('#big_img').fadeOut('slow', function(){  
                $('#big_img').attr('src', '_img/p_0003.jpg');  
                $('#big_img').fadeIn('slow');  
            });  
        });  
     $('#thumb4')  
        .mouseover(function(){  
            $('#big_img').fadeOut('slow', function(){  
                $('#big_img').attr('src', '0004.jpg');  
                $('#big_img').fadeIn('slow');  
            });  
        });  
</script>
#big_img=フルサイズの画像のID
#thumb1、、、 =サムネイル#thumb2のID#thumb3#thumb4
ページのメインコードは、それが役立つ場合はPHPです。