图片注释的另类造法(腾讯)

来源:互联网 发布:淘宝助理捷易通 编辑:程序博客网 时间:2024/05/01 01:55

用CSS:

onmouseover="toolTip('广东、四川、上海、福建、江苏、浙江、湖北、辽宁、黑龙江地区用户请发送指令到 3777 。其他地区用户请发送指令到 9777 。')" onmouseout="toolTip()"

其完整的例子:

TEST.HTM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无线向导</title>
<style type="text/css">
<!--
body {
 font-family: Verdana;
 font-size: 12px;
 line-height: 150%;
 color: #666666;
 text-decoration: none;
 margin: 0px;padding: 0px;
}
td {
 font-family: Verdana;
 font-size: 12px;
 line-height: 160%;
 color: #666666;
 text-decoration: none;
}
a:link,a:visited,a:active
        { color: #FF6600;text-decoration: none;}
a:hover { color: #FF6600;text-decoration: none;}
.textbox_bg {
 border: 1px solid #7E9DB9;
}
.text_gary {
 color: #999999;
}
.text_blue1 {
 color: #0047D5;
}
.text_orange {
 color: #FF6600; font-size: 10px;

}
.text_blank {
 color: #000000;
}
.boder_bottom {
 border-bottom-width: 1px;
 border-bottom-style: solid;
 border-bottom-color: #CCCCCC;
}
.bg_repeatx  { background-repeat: repeat-x;}
.tbox_bg  { background-image: url(http://sms.qq.com/common/images/bg_textbox.gif); border: 1px solid #999999; height: 16px; font-family: "Verdana"; }
.border {
 border: 1px solid #CCCCCC;
}
.nou {text-decoration: none;}
.t_blue14 {
 font-size: 14px;
 color: #011961;
 font-weight: bold;
}
#function_tt {
 color: #0047D5;
 height: 317px;
 width: 190px;
 border: 1px solid #B4B9F0;
}
.functions {
 color: #000000;
 margin: 12px 10px;
 padding-left: 18px;
}
.function1 {
 background: url(http://imaged.client.qq.com:8080/images/mqq2006/icon_fuction1.gif) no-repeat left 0.3em;
}
.function2 {
 background: url(http://imaged.client.qq.com:8080/images/mqq2006/icon_fuction2.gif) no-repeat left 0.3em;
}
.function3 {
 background: url(http://imaged.client.qq.com:8080/images/mqq2006/icon_fuction3.gif) no-repeat left 0.3em;
}
.function4 {
 background: url(http://imaged.client.qq.com:8080/images/mqq2006/icon_fuction4.gif) no-repeat left 0.3em;
}
.function5 {
 background: url(http://imaged.client.qq.com:8080/images/mqq2006/icon_fuction5.gif) no-repeat left 0.3em;
}
#wrap_apply_net {
 background: url(http://imaged.client.qq.com:8080/images/mqq2006/bg_apply_net.gif) no-repeat bottom;
 height: 125px;
 width: 255px;
}
#apply_net_tt {
 background: #FFFFFF;
 margin-left: 12px;
 width: 6em;
 color: #0047D5;
}
#wrap_apply_sms {
 background: url(http://imaged.client.qq.com:8080/images/mqq2006/bg_apply_sms.gif) no-repeat bottom;
 height: 157px;
 width: 255px;
}
#apply_sms_tt {
 background: #FFFFFF;
 margin-left: 12px;
 width: 8em;
 color: #0047D5;
}
-->
</style>
<script language="JavaScript">
<!--
function checkmobile(mobile)
{
 var len = mobile.length;
 if (len == 0){
  alert('请输入您的手机号码');
  return false;
 }
 if (len < 10 || len > 13 || /[^0-9]/g.test(mobile)){
  alert('手机号码有误,请重新输入');
  return false;
 }
 return true;
}
function sendsms()
{
 var mobile = form1.MobileNo.value;
    if (checkmobile(mobile)==true)
    {
     if(mobile.substr(0,1) == '0')
      mobile = "86" + mobile.substr(1, mobile.length-1);
     url = 'http://mqqopen.qq.com/cgi-bin/quick_open.cgi?mobile='+mobile+'&service=clientb&popflag=N';
this.window.location = url;
//  window.open(url);(如需要新窗口打开,只需要用此句代替下面一句)
    }
}
function router()
{
 var mobile = form1.MobileNo.value;
 if (checkmobile(mobile)==true)
 {
  if(mobile.substr(0,1) == '0')
   mobile = "86" + mobile.substr(1, mobile.length-1);
     url = 'http://mqqopen.qq.com/cgi-bin/router.cgi?mobile='+mobile+'&service=clientb&popflag=N';
this.window.location = url;
//  window.open(url);(新窗口打开)
 }
}
//tooltip
var ns4 = document.layers;

var ns6 = document.getElementById && !document.all;

var ie4 = document.all;

offsetX = -150;

offsetY = 20;

var toolTipSTYLE="";

function initToolTips()

{

  if(ns4||ns6||ie4)

  {

    if(ns4) toolTipSTYLE = document.toolTipLayer;

    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;

    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;

    if(ns4) document.captureEvents(Event.MOUSEMOVE);

    else

    {

      toolTipSTYLE.visibility = "visible";

      toolTipSTYLE.display = "none";

    }

    document.onmousemove = moveToMouseLoc;

  }

}

function toolTip(msg, fg, bg)

{

  if(toolTip.arguments.length < 1) // hide

  {

    if(ns4) toolTipSTYLE.visibility = "hidden";

    else toolTipSTYLE.display = "none";

  }

  else // show

  {

    if(!fg) fg = "#333333";

    if(!bg) bg = "#ffffcc";

    var content =

    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +

    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg +

    '"><td><font face="sans-serif" color="' + fg +

    '">' + msg +

    '&nbsp/;</font></td></table></td></table>';

    if(ns4)

    {

      toolTipSTYLE.document.write(content);

      toolTipSTYLE.document.close();

      toolTipSTYLE.visibility = "visible";

    }

    if(ns6)

    {

      document.getElementById("toolTipLayer").innerHTML = content;

      toolTipSTYLE.display='block'

    }

    if(ie4)

    {

      document.all("toolTipLayer").innerHTML=content;

      toolTipSTYLE.display='block'

    }

  }

}

function moveToMouseLoc(e)

{

  if(ns4||ns6)

  {

    x = e.pageX;

    y = e.pageY;

  }

  else

  {

    x = event.x + document.body.scrollLeft;

    y = event.y + document.body.scrollTop;

  }

  toolTipSTYLE.left = x + offsetX;

  toolTipSTYLE.top = y + offsetY;

  return true;

}

-->
</script>
<iframe width="0" height="0" src="/ping.htm"></iframe>
</head>

<body scroll="no">
<table width="479" height="31" border="0" align="center" cellpadding="0" cellspacing="0" background="http://imaged.client.qq.com:8080/images/mqq2006/top_bg.jpg">
  <tr>
    <td><img src="http://imaged.client.qq.com:8080/images/mqq2006/icon_mobile.gif" width="14" height="22" hspace="10" align="absmiddle" /><span class="t_blue14">移动QQ—把QQ装进手机里</span></td>
    <td align="right"><a href="notice.html">
      <!--<img src="http://imaged.client.qq.com:8080/images/mqq2006/bt_notice.gif" width="102" height="21" hspace="10" border="0" />-->
    </a></td>
  </tr>
</table>
<table width="479" border="0" align="center" cellpadding="0" cellspacing="8">
  <tr>
    <td rowspan="3"><table width="190" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><fieldset align="center" id="function_tt"> <legend>移动QQ超强功能</legend>
    <div class="functions function1">手机短信上QQ,随时随地与QQ好友聊天</div>
    <div class="functions function2">QQ上的酷炫金色小手机,好友免费发短信联系你</div>
    <div class="functions function3">最大的交友平台,亿万QQ用户等你约会</div>
    <div class="functions function4">新增超强娱乐功能,笑话、占卜、天气,总有你喜欢的</div>
    <div class="functions function5">GPRS用户更可率先体验手机软件版移动QQ,和电脑用QQ一样能显示头像发表情</div>
</fieldset></td>
</tr>
</table></td>
    <td><div id="wrap_apply_net">
      <div id="apply_net_tt">网上开通方式</div>
      <table border="0" align="center" cellpadding="0" cellspacing="5">
      <form id="form1" name="form2" method="post" action="" onsubmit="router(); return false;">
                    <input type="hidden" name="URL" value="http://webreg.qq.com:81/cgi-bin/web_reg_finish.cgi" />
                    <input type="hidden" name="Info" value="OPEN" />
                    <input type="hidden" name="Stn" value="$Stn$" />
                    <input type="hidden" name="OpenNew" value="N" />
                    <input type="hidden" name="SCmd" value="MQ">
                    <input type="hidden" name="SType" value="order" />
                    <input type="hidden" name="ServiceType" value="-LTMQQ" />
                    <input type="hidden" name="Style" value="mq" />
                    <input type="hidden" name="ItemID" value="webH" />
            <tr>
              <td align="center"><span class="text_blank">手机/小灵通:</span>
                <input name="MobileNo" type="text" class="textbox_bg" value="13" size="18" maxlength="15" />              </td>
            </tr>
            <tr>
              <td align="center"><input name="image2" type="image" hspace="10" src="http://imaged.client.qq.com:8080/images/mqq2006/bt_apply_net.gif" onclick="router(); return false;" />
                <input name="image3" type="image" hspace="10" src="http://imaged.client.qq.com:8080/images/mqq2006/bt_apply_sms.gif"  onclick="sendsms();return false;"/></td>
            </tr>
            <tr>
              <td>小灵通号码输入格式:区号+小灵通号码<br />
              (例如:075587654321)</td>
            </tr>
          </form>
        </table>
    </div>    </td>
  </tr>
  <tr>
    <td valign="top"><div id="wrap_apply_sms">
      <div id="apply_sms_tt">短信快速开通方式</div>
      <table width="85%" height="130" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="13%" align="center"><img src="http://imaged.client.qq.com:8080/images/mqq2006/logo_gmcc.gif" width="19" height="19" align="absmiddle" /></td>
          <td width="87%"> 移动用户发送MQH到1700</td>
        </tr>
        <tr>
          <td align="center"><img src="http://imaged.client.qq.com:8080/images/mqq2006/logo_uni.gif" width="23" height="15" align="absmiddle" /></td>
          <td> 联通用户发送MQ到3777 <img src="http://mobile.qq.com/images/bt_notemini.gif" border="0" align="absbottom" onmouseover="toolTip('广东、四川、上海、福建、江苏、浙江、湖北、辽宁、黑龙江地区用户请发送指令到 3777 。其他地区用户请发送指令到 9777 。')" onmouseout="toolTip()" /></td>
        </tr>
        <tr>
          <td align="center"><img src="http://imaged.client.qq.com:8080/images/mqq2006/logo_dx.gif" width="17" height="18" align="absmiddle" /></td>
          <td> 电信小灵通用户发送MQH到1700</td>
        </tr>
        <tr>
          <td align="center"><img src="http://imaged.client.qq.com:8080/images/mqq2006/logo_wt.gif" width="18" height="17" align="absmiddle" /></td>
          <td> 网通小灵通用户发送MQH到17000</td>
        </tr>
      </table>
    </div></td>
  </tr>
  <tr>
    <td align="center" valign="top"><a id="a_guide" href="http://mobile.client.qq.com/cgi-bin/guide.cgi?GoToGuide=Y"><img src="http://imaged.client.qq.com:8080/images/mqq2006/icon_viewmore.gif" width="16" height="18" border="0" align="absmiddle" /> <span class="text_blue1">查看其他无线QQ服务</span>&nbsp;&nbsp;&nbsp;<img src="http://imaged.client.qq.com:8080/images/mqq2006/icon_bd.gif" width="19" height="18" border="0" align="absmiddle" /> <span class="text_blue1">我要绑定</span></a></td>
  </tr>
</table>
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="JavaScript"><!--
initToolTips(); //--></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
 var url = location.href;
 var index = url.indexOf("?");
 var length = url.length;
 var parameter = url.substr(index+1, length - index);
 document.getElementById("a_guide").href = "http://mobile.client.qq.com/cgi-bin/guide.cgi?GoToGuide=Y&"+parameter;

//-->
</SCRIPT>
</body>
</html>

原创粉丝点击