关于鼠标移动事件和图片放大效果的问题
简单说下,我的目的:有若干图片,我想在鼠标划过的时候,在另一个地方显示其放大的图片,具体代码如下:
现在一个图片可以达到这样的效果,如果很多的图片怎么办?如果设变量的话,
在静态页面中,和动态页面中从数据库调用图片怎么设?请说具体点,谢谢!
或者不用我下面的代码,还有什么方法?
<script language= "JavaScript ">
<!--
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i <(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v== 'show ')? 'visible ':(v= 'hide ')? 'hidden ':v; }
obj.visibility=v; }
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf( "? "))> 0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i <d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i <d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
<a href= " " onClick= "return false "> <img name= "small " border= "0 " src= "image312/NO.HJD32001-2.jpg " width= "90 " height= "133 " onMouseOver= "MM_showHideLayers( 'layer2 ', ' ', 'show ');MM_showHideLayers( 'layer ', ' ', 'hide ');MM_showHideLayers( 'layer1 ', ' ', 'hide '); "> </a>
<div id= "layer2 " style= "position: absolute; left: -120px; top: 165px; width: 765; height: 202; z-index: 1; visibility: hidden ">
<table border= "0 " width= "761 " height= "216 " cellspacing= "0 " cellpadding= "0 ">
<tr bordercolor= "#FFFFFF ">
<td width= "624 " valign= "top " align= "left ">
<table border= "0 " width= "122% " height= "181 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "100% " height= "151 " align= "center "> <a href= " " onclick= "return false " > <img name= "big " src= "image312/NO.HJD32001-2.jpg " onclick= "MM_showHideLayers( 'layer2 ', ' ', 'hide ');MM_showHideLa