怎么样在图片上加一个删除小图片 把两张照片分别放在两个层里,然后把他们分别放在你希望的位置,然后对层(删除)调用mouseOver和mouseOut事件,就比较简单了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 第三次发这段代码效果和LZ要求的类似:移动到图片上后,显示全图,全图上有超链接支持 IE6 和 FF<script>var eventX;var eventY;var flag1 = false;// 光标是否在原图上var flag2 = false;// 是否在全图上document.onmousemove=setPoint;function setPoint(e){ e = e ? e : event; eventX = e.clientX ? e.clientX : e.x; eventY = e.clientY ? e.clientY : e.y; eventY += document.body.scrollTop;// 如果加入了 W3C 标准,则是 document.documentElement.scrollTop}function showFullImg(imgSrc,aHref){ flag1 = true; setTimeout("showPic('" + imgSrc + "','" + aHref + "')",1000);}function showPic(imgSrc,aHref){ document.getElementById("aaa").href = aHref; document.getElementById("fullImg").src = imgSrc; document.getElementById("fullImg").style.top = eventY + "px"; document.getElementById("fullImg").style.left = eventX + "px"; document.getElementById("fullImg").style.display = "block";}function hidePic(){ if(!flag1 && !flag2){ document.getElementById("fullImg").style.display = "none"; }}function hideFullImg(){ setTimeout("hidePic()",300);}</script><a id="aaa" href="" target="_blank"><img id="fullImg" style="display:none;width:150px;position:absolute;" onmouseover="flag2=true;" onmouseout="flag2=false;hideFullImg()"/></a><img src="http://i3.sinaimg.cn/home/deco/2008/0325/sinahome_Logo.gif" style="overflow:hidden;width:100px;" onmouseover="showFullImg(this.src,'http://www.sina.com.cn/')" onmouseout="flag1=false;hideFullImg()"/><img src="http://img1.cache.netease.com/cnews/netease/logo.gif" style="overflow:hidden;width:100px;" onmouseover="showFullImg(this.src,'http://www.163.com/')" onmouseout="flag1=false;hideFullImg()"/><br/>下面还有一个<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><img src="http://google.cn/intl/zh-CN/images/logo_cn.gif" style="overflow:hidden;width:100px;" onmouseover="showFullImg(this.src,'http://www.google.cn/')" onmouseout="flag1=false;hideFullImg()"/> 这样就是我现在做到的,我是要小图放在大图里面当放到小图时,大图发生了mouseOut,小图也不见也, 设置两个标记,分别判断是否在大图和小图上在 mouseout 的时候检查这两个标记,当他们同时为 false 的时候(不在大图上,也不在小图上)就隐藏小图,否则不隐藏参照 2 楼的代码 下拉类表框一个不见了 谁能帮忙解决下Extjs中grid空中的数据可以用Ctrl+c进行copy 100分求怎样做一个Flash效果的图片切换? 各位老大,为什么window.open()无法刷新啊? 奇怪的外部js文件 window.open()如何控制只能打开一个窗口? 关于网页对话框的问题 新手求助,关于js文件的问题,在线等待!!! 标记"target"是什么作用? 有没有用javascript进行base64编码的代码? [十万火急]DIV移动层右键问题 (a_id >> 16) & 0xff 的vbscript 写法是??
效果和LZ要求的类似:移动到图片上后,显示全图,全图上有超链接
支持 IE6 和 FF<script>
var eventX;
var eventY;
var flag1 = false;// 光标是否在原图上
var flag2 = false;// 是否在全图上
document.onmousemove=setPoint;
function setPoint(e){
e = e ? e : event;
eventX = e.clientX ? e.clientX : e.x;
eventY = e.clientY ? e.clientY : e.y;
eventY += document.body.scrollTop;// 如果加入了 W3C 标准,则是 document.documentElement.scrollTop
}function showFullImg(imgSrc,aHref){
flag1 = true;
setTimeout("showPic('" + imgSrc + "','" + aHref + "')",1000);
}function showPic(imgSrc,aHref){
document.getElementById("aaa").href = aHref;
document.getElementById("fullImg").src = imgSrc;
document.getElementById("fullImg").style.top = eventY + "px";
document.getElementById("fullImg").style.left = eventX + "px";
document.getElementById("fullImg").style.display = "block";
}function hidePic(){
if(!flag1 && !flag2){
document.getElementById("fullImg").style.display = "none";
}
}function hideFullImg(){
setTimeout("hidePic()",300);
}
</script>
<a id="aaa" href="" target="_blank">
<img id="fullImg" style="display:none;width:150px;position:absolute;" onmouseover="flag2=true;" onmouseout="flag2=false;hideFullImg()"/>
</a>
<img src="http://i3.sinaimg.cn/home/deco/2008/0325/sinahome_Logo.gif" style="overflow:hidden;width:100px;" onmouseover="showFullImg(this.src,'http://www.sina.com.cn/')" onmouseout="flag1=false;hideFullImg()"/>
<img src="http://img1.cache.netease.com/cnews/netease/logo.gif" style="overflow:hidden;width:100px;" onmouseover="showFullImg(this.src,'http://www.163.com/')" onmouseout="flag1=false;hideFullImg()"/>
<br/>
下面还有一个<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><img src="http://google.cn/intl/zh-CN/images/logo_cn.gif" style="overflow:hidden;width:100px;" onmouseover="showFullImg(this.src,'http://www.google.cn/')" onmouseout="flag1=false;hideFullImg()"/>
这样就是我现在做到的,
我是要小图放在大图里面
当放到小图时,大图发生了mouseOut,小图也不见也,
在 mouseout 的时候检查这两个标记,当他们同时为 false 的时候(不在大图上,也不在小图上)
就隐藏小图,否则不隐藏
参照 2 楼的代码