⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 supershow.jsp~139~

📁 这个例子是实现一个汽泡的效果。 不过用的是Ajax技术哦。
💻 JSP~139~
字号:
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="mycss.css" type="text/css"  rel=stylesheet/>
<title>supershow</title>
<script language="javascript" type="text/javascript">
var xmlHttp;
var globalName;
function createXMLHttp()
{
  if(window.XMLHttpRequest)
    xmlHttp=new XMLHttpRequest();
  else if(window.ActiveXObject)
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}

function startRequest(name)
{
  globalName=name;
  createXMLHttp();
  xmlHttp.onreadystatechange=requestHandle;
  xmlHttp.open("GET","/BubbleModule/xml/picture.xml",true);
  xmlHttp.send(null);
}
function requestHandle()
{
  if(xmlHttp.readyState==4)
  {
    //获得所有的picture标签
    var pictures=xmlHttp.responseXML.getElementsByTagName("picture");

    for(var i=0;i<pictures.length;i++)
    {
      //获得单个picture
      var pic=pictures[i];
      //获得picture的子节点id的文本
      var picName=pic.getElementsByTagName("name")[0].firstChild.nodeValue;
      //获得picture的子节点directory的文本
      var picDir=pic.getElementsByTagName("directory")[0].firstChild.nodeValue;
      //获得提出请求的标签
      var tagImage = document.getElementById(globalName);
      //判断获得的文本是否和提出请求的标签的名称相同
      if(picName==globalName)
          tagImage.src=picDir;
       }
      globalName="";
      document.getElementById("im").style.zIndex=100;
      document.getElementById("im").style.display="block";
  }
}
</script>
<link href="../js/mycss.css" type=text/css rel=stylesheet>
</head>
<body>
<h2>Super show</h2>
<hr>
<table width="162" border="0" cellspacing="5" cellpadding="0">

   <tr>
  <td>
 <a  href="#" class=tipS  onMouseOver="startRequest('Tab11')" onmouseout="im.style.display='none';">
        <img style="cursor:hand" src="../image/Tab11.jpg" width="56" height="65" alt="" />
        <div id="im" class="divImg"><img id="Tab11"style="cursor:hand" alt="" src=""> </span></a>
  </td>
  </tr>
    <tr>
  <td>
 <a  href="#" class=tipS  onMouseOver="startRequest('mall')">
	<img style="cursor:hand" src="../image/mall.jpg" width="56" height="65" alt="" />
	<div id="im" class="divImg"><img id="mall"style="cursor:hand" alt="" src="" width="100" height="120">
 </span></a>
  </td>
  </tr>
</table>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -