管理学重点知识:关于TITLE 提示问题,在线等,谢谢。

来源:百度文库 编辑:高考问答 时间:2024/05/15 12:57:18
本人想做以下的页面效果,请高手帮忙,在此表示感谢。
<a href="www.baidu.com" title="baidu首页">连接</a>
或者<img src="http://img.baidu.com/img/logo-zhidao.gif" title="baiduLOGO">

正常这样的提示只是文字提示,我想在这个提示中增加图片以及连接,在鼠标经过连接文字或者图片的时候,在连接文字或者图片的旁边会有提示,当鼠标移到提示上的时候可以点击提示上的连接,我曾经尝试过用DIV来做,但是页面的大小会有变动,没有办法很好的控制DIV的相对位置,是否有比较好的方法?请各位高手给出代码,尽量使用JAVASCRIPT,谢谢。
如果本人说明不清晰,请回复,我会做出补充。
请注意,并不是单纯的提示,比如鼠标放上去会提示出一个图片,并且我可以点击这个图片连接到其他页面。楼下的回答并不正确,不过十分感谢。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
</script>
</head>
<body>
<a href="www.baidu.com" title="baidu首页" onMouseOver="MM_showHideLayers('Layer1','','show')">连接</a>
或者<img src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-zhidao.gif" title="baiduLOGO" onMouseOver="MM_showHideLayers('Layer3','','show')">
<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; left: 11px; top: 57px; visibility: hidden;">
<div id="Layer2" style="position:absolute; width:200px; height:115px; z-index:1"><a href="http://www.baidu.com"><img src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-zhidao.gif" border="1" title="baiduLOGO" onMouseOut="MM_showHideLayers('Layer1','','hidden')"></a></div>
</div>
<div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:1; left: 103px; top: 57px; visibility: hidden;">
<div id="Layer4" style="position:absolute; width:200px; height:115px; z-index:1"><a href="http://www.baidu.com"><img src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-zhidao.gif" border="1" title="baiduLOGO" onMouseOut="MM_showHideLayers('Layer3','','hidden')"></a></div>
</div>
</body>
</html>

<style>
<!--
a:link { color: #0000ff; text-decoration: none; font-size: 9pt}
a:visited { color:#0000ff; text-decoration: none; font-size: 9pt}
a:hover { color: #ff0000; text-decoration: underline; font-size: 9pt}
#PCL {
font-family:宋体 ;
font-style: none;
font-weight: normal;
text-decoration: none;
font-size: 9pt;
}
#PTT {
font-family: 宋体;
font-size: 9pt;
}
#PST {
font-family:宋体;
font-size: 9pt;
}
-->
</style>

<body>
<div ID="overDiv" STYLE="position:absolute; visibility:hide; z-index: 1;"></div>
<script LANGUAGE="JavaScript">
if (typeof fcolor == 'undefined') { var fcolor = "F1E4E4";}
if (typeof backcolor == 'undefined') { var backcolor = "804040";}
if (typeof textcolor == 'undefined') { var textcolor = "000000";}
if (typeof capcolor == 'undefined') { var capcolor = "FFFFFF";}
if (typeof closecolor == 'undefined') { var closecolor = "#9999FF";}
if (typeof width == 'undefined') { var width = "200";}
if (typeof border == 'undefined') { var border = "1";}
if (typeof offsetx == 'undefined') { var offsetx = 10;}
if (typeof offsety == 'undefined') { var offsety = 10;}
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
if (ie4) {
if (navigator.userAgent.indexOf('MSIE 5')>0) {
ie5 = true;
} else {
ie5 = false; }
} else {
ie5 = false;
}
var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
var tr = 1;
if ( (ns4) || (ie4) ) {
if (ns4) over = document.overDiv
if (ie4) over = overDiv.style
document.onmousemove = mouseMove
if (ns4) document.captureEvents(Event.MOUSEMOVE)
}
function drs(text) {
dts(1,text);
}
function drc(text, title) {
dtc(1,text,title);
}
function src(text,title) {
stc(1,text,title);
}
function dls(text) {
dts(0,text);
}
function dlc(text, title) {
dtc(0,text,title);
}
function slc(text,title) {
stc(0,text,title);
}
function dcs(text) {
dts(2,text);
}
function dcc(text, title) {
dtc(2,text,title);
}
function scc(text,title) {
stc(2,text,title);
}
function nd() {
if ( cnt >= 1 ) { sw = 0 };
if ( (ns4) || (ie4) ) {
if ( sw == 0 ) {
snow = 0;
hideObject(over);
} else {
cnt++;
}
}
}
<!-- 此特效使用《网页特效精灵》编辑制作-->
<!-- 奥天软件:http://www.aosky.net-->
function dts(d,text) {
txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Arial,Helvetica\" COLOR=\""+textcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
layerWrite(txt);
dir = d;
disp();
}
function dtc(d,text, title) {
txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
layerWrite(txt);
dir = d;
disp();
}
function stc(d,text, title) {
sw = 1;
cnt = 0;
txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
layerWrite(txt);
dir = d;
disp();
snow = 0;
}
function disp() {
if ( (ns4) || (ie4) ) {
if (snow == 0) {
if (dir == 2) {
moveTo(over,x+offsetx-(width/2),y+offsety);
}
if (dir == 1) {
moveTo(over,x+offsetx,y+offsety);
}
if (dir == 0) {
moveTo(over,x-offsetx-width,y+offsety);
}
showObject(over);
snow = 1;
}
}
}
function mouseMove(e) {
if (ns4) {x=e.pageX; y=e.pageY;}
if (ie4) {x=event.x; y=event.y;}
if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
if (snow) {
if (dir == 2) {
moveTo(over,x+offsetx-(width/2),y+offsety);
}
if (dir == 1) {
moveTo(over,x+offsetx,y+offsety);
}
if (dir == 0) {
moveTo(over,x-offsetx-width,y+offsety);
}
}
}
function cClick() {
hideObject(over);
sw=0;
}
function layerWrite(txt) {
if (ns4) {
var lyr = document.overDiv.document
lyr.write(txt)
lyr.close()
}
else if (ie4) document.all["overDiv"].innerHTML = txt
if (tr) { trk(); }
}
function showObject(obj) {
if (ns4) obj.visibility = "show"
else if (ie4) obj.visibility = "visible"
}
function hideObject(obj) {
if (ns4) obj.visibility = "hide"
else if (ie4) obj.visibility = "hidden"
}
function moveTo(obj,xL,yL) {
obj.left = xL
obj.top = yL
}
function trk() {
if ( (ns4) || (ie4) )
tr = 0;
}
</script>
<a HREF="http://www.aosky.net" target="_blank" onMouseOver="drc('为你提供最酷的主页特效!','奥天软件'); return true;" onMouseOut="nd(); return true;">奥天软件</a><br>
<a HREF="http://www.aodufilm.net" target="_blank" onMouseOver="drc('提供最新、最热的电影下载!','奥都影城'); return true;" onMouseOut="nd(); return true;">奥都影城</a><br>
<a HREF="http://www.sina.com.cn" target="_blank" onMouseOver="drc('我喜欢看它的新闻!','新浪网站'); return true;" onMouseOut="nd(); return true;">新浪网站</a><br>
<a HREF="http://www.newhua.com.cn" target="_blank" onMouseOver="drc('要下载软件就到这里找。','华军软件园'); return true;" onMouseOut="nd(); return true;">华军软件园</a><br>
<a HREF="http://www.netease.com" target="_blank" onMouseOver="drc('三大门户网站之一呀!','网易'); return true;" onMouseOut="nd(); return true;">网易</a><br>