请问

zmy0611 2003-05-20 10:16:17
请问如何得到 如帮助文件中的那种popup
...全文
68 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
fason 2003-05-20
  • 打赏
  • 举报
回复
<html>
<head>
<script Language="JavaScript">
//***********默认设置定义.*********************
tPopWait=50;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;

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

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { background-color: #F8F8F5;color:#000000; border: 1px #000000 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.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.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;
</script>
</head>
<BODY>
<a href="dispbbs.asp?boardID=6&RootID=56&ID=56" title="我想请问斑竹?<br>作者:农民<br>发表于2002-6-3 20:17:16<br>最后跟贴:呵呵,是住我们......">我想请问斑竹?</a>

接着前面的
</body>

zhjzh_zjz 2003-05-20
  • 打赏
  • 举报
回复
ie6 支持 popup,不过一般的地方用不着。需要提示的地方,用tittle就可以了。你搜索以下 popup,论坛里面多的是。
<input tittle='这是提示信息'>
zmy0615 2003-05-20
  • 打赏
  • 举报
回复
<script language=javascript>

alert("asdddddddddd".substr(1,1))
popstyle= "Verdana,10,,";//?出式?助字体?定
function showPophelp(helpstr,w,h,Foreground,Background)
{
pophelp.TextPopup(helpstr,popstyle,w,h,Foreground,Background);
}
</script>
</head>
<body>
<CENTER>
<OBJECT id=pophelp type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM name="Command" value="HH Version">
</OBJECT>

<span onclick="javascript:body.style.cursor='help';" style="cursor:help;"><big><b>?</b></big></span>(說明:先點擊前面"?"符號,當滑鼠樣式變?"求助"時,點擊下面文字。)<br>
<span onclick="showPophelp('這是彈出式幫助',20,20,0,255)">彈出式幫助</span><br><br>
<span onclick="showPophelp('我是wingfancy,歡迎大家一起討論網路編程技術。',20,120,0,0)">wingfancy</span><br><br>
<span onclick="showPophelp('<input type=button>',20,20,0,0)">電子信箱</span><br><br>
<span onclick="showPophelp('http://www.5meng.com',20,20,0,0)">網址</span><br><br>

87,987

社区成员

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

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