実際、マウスオーバーで画像にズームイン効果を与えるためのこのチュートリアルを見ました。画像はテーブルにないので、画像をテーブル内に配置して画像の位置を相対的に設定することで同じ効果を得ることができますか?
お気に入り
<table border = '2'>
<tr>
<td>
<img id="a1" src="http://demos.frnzzz.com/imgZoom/1.jpg" height="50" width="50">
</td>
<td>
<img id="a2" src="http://demos.frnzzz.com/imgZoom/1.jpg" height="50" width="50">
</td>
</tr>
</table>
テーブル内に画像を配置しようとすると、効果が変化し、テーブルのサイズも大きくなりますが、テーブルのサイズはそのままにしておく必要があります。
画像にズームインおよびズームアウト効果を与えるために次のコードを使用していますが、mozilla firefox ではうまく機能しますが、google chrome では機能しません。クロムでは、テーブルの列サイズも拡張されています(z-indexが機能していません)。img1はテーブルタグ内にあります。
function zoomIn(indexNo){
var zoomin = $('#img1').attr("zoomin");
if(zoomin == "false")
{
$('#img1').css("z-index", 1);
$('#img1').css("position", "absolute");
$('#img1').animate({
height : l_imgHeightZoomIn,
width : l_imgWidthZoomIn,
left : l_imgLeftZoomIn,
top : l_imgTopZoomIn
}, "slow");
$('#img1').attr("zoomin", "true");
}
}
--------------------------------------------------------------
function zoomOut(indexNo){
var zoomin = $('#img1').attr("zoomin");
if(zoomin == "true")
{
$('#img1').css("z-index", 0);
$('#img1').css("position", "static");
$('#img1').animate({
height : l_imgHeight,
width : l_imgWidth,
left : l_imgLeftZoomOut,
top : l_imgTopZoomOut
}, 0);
$('#img11').attr("zoomin", "false");
}
}