|
主题: 为什么添加了alt,鼠标移至的时候还是没有显示啊?
|
 暮逸
职务:普通成员
等级:3
金币:0.0
发贴:1149
注册:2003/3/20 8:02:19
|
|
 未来
职务:版主
等级:5
金币:10.0
发贴:2730
注册:2001/11/2 18:37:09
|
#22003/5/14 11:13:32
应该是添加title显示提示文字。 alt只对图片有效,其实两者的功能是不同的,alt主要起替代作用,也有提示的作用。
|
 { 在指尖上绽放的花朵 }
职务:普通成员
等级:5
金币:14.0
发贴:3209
注册:2002/7/25 21:24:11
|
#32003/5/14 12:30:34
alt 是在图片显示失败的时候,作为替代性的文字。 优先级是低于title 的,验证代码如下~ 
并且,alt 是图片专有的一个属性,对于其他元素来说, 只有title 有效。
|
 chinaboy2008
职务:普通成员
等级:1
金币:0.0
发贴:65
注册:2003/4/24 15:47:12
|
#42003/5/14 15:24:04
对对对!!!! 我又学到了东西,TITLE=“MY TEST” 好的!!! -------------------------------------------------------------------------------------------- 看我的!!!! 中国高跟鞋俱乐部!!!! www.sharpheel.com如果有人出高薪!!!请我的我会跳槽!!!! QQ:67221565
|
 暮逸
职务:普通成员
等级:3
金币:0.0
发贴:1149
注册:2003/3/20 8:02:19
|
#52003/5/14 16:17:58
谢谢,问题解决了  但是为什么鼠标移动时字反映特别慢 呢?
|
 盛装五步
职务:普通成员
等级:3
金币:12.0
发贴:731
注册:2004/12/1 20:15:39
|
#62003/5/14 16:19:50
暮逸在上个帖子中说 引用: 谢谢,问题解决了 :p 但是为什么鼠标移动时字反映特别慢 呢? :confused: :confused:
原本就是这样的,你想要鼠标跟随或是及时反映出来的话,需要用层模拟
|
 { 在指尖上绽放的花朵 }
职务:普通成员
等级:5
金币:14.0
发贴:3209
注册:2002/7/25 21:24:11
|
#72003/5/14 17:40:22
很早之前一个前辈给我的层模拟代码~ //***********默认设置定义.*********************
tPopWait=50;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=10;
popOpacity=100;
//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;
document.write("");
document.write("");
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.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
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.opacity0) {
dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.onmouseover=showPopupText;
使用的时候像这样就可以了~
|