改了一下,不知道ok?
function show(v){
mydiv.style.display="block"
mydiv.style.left=event.srcElement.offsetLeft+a1.offsetWidth
mydiv.style.top=event.srcElement.offsetTop+a1.offsetHeight
as.src="image/baocun.jpg";
}
function show(v){
mydiv.style.display="block"
mydiv.style.left=event.srcElement.offsetLeft+a1.offsetWidth
mydiv.style.top=event.srcElement.offsetTop+a1.offsetHeight
as.src="image/baocun.jpg";
}
="show('big/1.jpg')"
难道不能这样传?
function show(){
mydiv.style.display="block"
as.src=event.srcElement.src;
as.width=event.srcElement.offsetWidth*3;
as.height=event.srcElement.offsetHeight*3;
mydiv.style.top=event.srcElement.offsetTop+a1.offsetHeight;
mydiv.style.left=event.srcElement.offsetLeft+a1.offsetWidth;
}
function hide(){
mydiv.style.display="none"
}
</script>
<img src="http://img.blog.163.com/photo/Xtty06Tl0O0MEAitJ-cfRw==/3155897438879964244.jpg" width="140" height="120" onMouseOver="show()" onMouseOut="hide()" name="a1">
<img src="http://st.blog.163.com/style/common/index/logo.jpg" width="140" height="120" onMouseOver="show()" onMouseOut="hide()">
<img src="http://img.blog.163.com/photo/Xtty06Tl0O0MEAitJ-cfRw==/3155897438879964244.jpg" width="140" height="120" onMouseOver="show()" onMouseOut="hide()">
<img src="http://img.blog.163.com/photo/Xtty06Tl0O0MEAitJ-cfRw==/3155897438879964244.jpg" width="140" height="120" onMouseOver="show()" onMouseOut="hide()">
<img src="http://img.blog.163.com/photo/Xtty06Tl0O0MEAitJ-cfRw==/3155897438879964244.jpg" width="140" height="120" onMouseOver="show()" onMouseOut="hide()"><div id="mydiv" style="position:absolute; z-index:1; display:none;">
<img src="http://img.blog.163.com/photo/Xtty06Tl0O0MEAitJ-cfRw==/3155897438879964244.jpg" name="as">
</div>
我大图的URL地址是在另一个文件夹的!所以要传入show(v)!
你上面写的只是将小图放大?
as.src = v;