求救,告诉我这个网页效果怎么做
来源:百度知道 编辑:UC知道 时间:2024/05/22 18:05:52
应该是利用鼠标的onmouseon事件,再配合控制div的显示或隐藏来实现的吧。要详细写出来比较麻烦,因为是脚本控制的效果,所以你可以在这个查看它的源代码,能看到的。
rewtq3
主要是通过 onMouseOver 和onMouseOut两个事件控制层的显示与隐藏,
再通过获取鼠标位置来给层定位
下面是它的源码
<script>
//--初始化变量--
// from webjx.com
var rT=false;//允许图像过渡
var bT=false;//允许图像淡入淡出
var tw=150;//提示框宽度
var endaction=false;//结束动画
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
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";
}