一幅图片上做了若干个热点,显示不同的文本内容,求鼠标事件最敏感的效果!

lawdoor 2004-04-01 03:21:23
一幅图片上做了若干个热点,求鼠标事件最敏感的效果!
<map name="Map">
<area shape="rect" coords="43,1,95,66" href="#">
<area shape="rect" coords="43,1,95,66" href="#">
<area shape="rect" coords="43,1,95,66" href="#">
<area shape="rect" coords="43,1,95,66" href="#">
<area shape="rect" coords="43,1,95,66" href="#">
</map>
不用title,alt等属性显示,反应太慢,因为要显示从数据库中调出的很多的数据!
...全文
85 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lawdoor 2004-04-04
  • 打赏
  • 举报
回复
谢谢tacit
我是李幕白!
呵呵,揭贴
tacit 2004-04-04
  • 打赏
  • 举报
回复
<a href='#' total="aaa"> lawdoor</a>
引进一个 js文件:
<!--//******************************************************************

//***********默认设置定义.*********************
tPopWait=50; //停留tWait豪秒后显示提示。
tPopShow=6000; //显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=95;
fontcolor="#000000";
bgcolor="#EDEDED";
bordercolor="#007db5";

//***************内部变量定义*****************
sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { background-color: " + bgcolor + ";color:" + fontcolor + "; border: 1px " + bordercolor + " solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText(){
var o=event.srcElement;
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.total!=null && o.total!=""){o.dypop=o.total;o.total=""};
if(o.dypop!=sPop) {
sPop=o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting);
if(sPop==null || sPop=="") {
dypopLayer.innerHTML="";
dypopLayer.style.filter="Alpha()";
dypopLayer.filters.Alpha.opacity=0;
}
else {
if(o.dyclass!=null) popStyle=o.dyclass
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);
}

}
}

function showIt(){
dypopLayer.className=popStyle;
dypopLayer.innerHTML=sPop;
popWidth=dypopLayer.clientWidth;
popHeight=dypopLayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
dypopLayer.style.filter="Alpha(Opacity=0)";
fadeOut();
}

function fadeOut(){
if(dypopLayer.filters.Alpha.opacity<popOpacity) {
dypopLayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);
}
else {
dypopLayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);
}
}

function fadeIn(){
if(dypopLayer.filters.Alpha.opacity>0) {
dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.onmouseover=showPopupText;
-->
lawdoor 2004-04-01
  • 打赏
  • 举报
回复
有例子么?麻烦讲清楚一些了!
LxcJie 2004-04-01
  • 打赏
  • 举报
回复
可以show一个tip,并且,预先取出数据,然后前台给态给tip赋值就可以了
lawdoor 2004-04-01
  • 打赏
  • 举报
回复
顶一下了,那位高手解决一下了?

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧