HTML-код немножко изменил:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="js/jquery-1.2.6.js" type="text/javascript"></script>
</head>
<body>
<div id="pic_m">
<img src="img/b1.jpg" border="0">
</div>
<a href="img/b1.jpg"><img class="pic" id="b1" src="img/m1.png" border="0"></a>
<a href="img/b2.jpg"><img class="pic" id="b2" src="img/m2.png" border="0"></a>
<a href="img/b3.jpg"><img class="pic" id="b2" src="img/m3.png" border="0"></a>
</body>
</html>
А JS-код так:
$(document).ready(function(){
$("img.pic").click(function(){
var path = $(this).parent().attr("href");
$("#pic_m").animate({opacity: 0},1000,function(){
$(this).html("<img src=" + path + " />").find("img").bind("load",function(){
$(this).parent().animate({opacity: 1},1000);
});
});
return false;
});
});