<script type="text/javascript" src="jquery.js"></script>
<script>
function hello() {
$('#myImage').fadeOut('slow',function(){
$(this).attr('src','2.jpg')
})
$('#myImage').fadeIn('slow')
}
</script>
<body>
<img src="1.jpg" id="myImage" />
<button onclick="hello();">click</button>
</body>