四种提示框代码
<head>
<title>图像效果演示</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
/*
舜子制作
Made by PuterJam
*/
//--初始化变量--
var rT=true;//允许图像过渡
var bT=true;//允许图像淡入淡出
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";
}
document.onmousemove = moveToMouseLoc;
}
}
function toolTip(msg, fg, bg)
{
if(toolTip.arguments.length < 1) // hide
{
if(ns4)
{
toolTipSTYLE.visibility = "hidden";
}
else
{
//--图象过渡,淡出处理--
if (!endaction) {toolTipSTYLE.display = "none";}
if (rT) document.all("msg1").filters[1].Apply();
if (bT) document.all("msg1").filters[2].Apply();
document.all("msg1").filters[0].opacity=0;
if (rT) document.all("msg1").filters[1].Play();
if (bT) document.all("msg1").filters[2].Play();
if (rT){
if (document.all("msg1").filters[1].status==1 || document.all("msg1").filters[1].status==0){
toolTipSTYLE.display = "none";}
}
if (bT){
if (document.all("msg1").filters[2].status==1 || document.all("msg1").filters[2].status==0){
toolTipSTYLE.display = "none";}
}
if (!rT && !bT) toolTipSTYLE.display = "none";
//----------------------
}
}
else // show
{
if(!fg) fg = "#777777";
if(!bg) bg = "#eeeeee";
var content =
@#<table id="msg1" name="msg1" border="0" cellspacing="0" cellpadding="1" bgcolor="@# + fg + @#" class="trans_msg"><td>@# +
@#<table border="0" cellspacing="0" cellpadding="3" bgcolor="@# + bg +
@#"><td width=@# + tw + @#><font face="Arial" color="@# + fg +
@#" size="-2">@# + msg +
@# \;</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@#
//--图象过渡,淡入处理--
var cssopaction=document.all("msg1").filters[0].opacity
document.all("msg1").filters[0].opacity=0;
if (rT) document.all("msg1").filters[1].Apply();
if (bT) document.all("msg1").filters[2].Apply();
document.all("msg1").filters[0].opacity=cssopaction;
if (rT) document.all("msg1").filters[1].Play();
if (bT) document.all("msg1").filters[2].Play();
//----------------------
}
}
}
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>
<style type="text/css">
<!--
.trans_msg
{
filter:alpha(opacity=100,enabled=1) revealTrans(duration=.2,transition=1) blendtrans(duration=.2);
}
-->
</style>
</head>
<script>
</script>
<body>
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<p>
<script>initToolTips()</script>
</p>
<p><font face="Arial"><a href="#" onMouseOver="toolTip(@#欢迎访问Blyesky的blog<br>希望你喜欢这里<br>^_^@#)" onMouseOut="toolTip()">效果1</a></font>
<font face="Arial"> <a href="#" onMouseOver="toolTip(@#你要吗,好好用的哦真的@#, @##FFFF00@#, @#red@#)" onMouseOut="toolTip()">效果2</a></font>
<font face="Arial"> <a href="#" onMouseOver="toolTip(@#这是个好东东<br>你说呢<br>哈哈@#, @##FFFF00@#, @#orange@#)" onMouseOut="toolTip()">效果3</a></font>
<font face="Arial"> <a href="#" onMouseOver="toolTip(@#<marquee>跑啊!!跑</marquee>@#, @##FFFF00@#, @#orange@#)" onMouseOut="toolTip()">效果4</a></font>
</p>
</body>
- · 收集的精典代码
- · 关于PHP的分页代码
- · 一家之言的经验之谈php+mysql扎实个人基本功
- · 用PHP写FTP文件上传
- · 用PHP写的MD5加密函数
- · 在php中输出html代码
- · php的pconnect()
- · PHP/ASP上传漏洞探究
- · 做个站内搜索引擎
- · heapsort(PHP)
- · 一个塑料期货交易程序分析图程序(PHP+JAVA)
- · 计算排列组合的php代码
- · 对页面的源代码进行加密,使源代码变成乱码,没法读取
- · 用phpUnit帮你调试php程序
- · PHP下对缓冲区的控制
- · PHP实现文件下载
- · 用PHP实现windows资源管理器风格的树型菜单
- · BS结构中使用PHP访问ORACLE LOB
- · 使用PHP 5.0 轻松解析XML文档(5)
- · 使用PHP 5.0 轻松解析XML文档(3)
- · 使用PHP 5.0 轻松解析XML文档(1)
- · PHP中实现面向对象编程(上)
- · PHP中接收复选框信息的方法
- · PHP操作IMAP服务器的类
- · PHP中时间和日期函数总结
- · PHP应用分页显示制作详细讲解(2)
- · PHP5中使用Web服务访问J2EE应用程序(4)
- · PHP5中使用Web服务访问J2EE应用程序(2)
- · PHP中通过Web执行C/C++应用程序
- · 用PHP编程开发“虚拟域名”系统
- · PHP中创建并处理图象
- · 用php编写的日历
- · PHP中的面向对象和面向过程
- · php如何更好更有效的实现-----用户注册页面
- · 上传多个文件的PHP脚本
- · php注入4
- · php注入2
- · PHP中类的理解和应用[二]
- · PHP计数器
- · 实例学习PHP之FastTemplate 模板篇
- · 关于PHP操作文件的一些FAQ总结
- · PHP 5/Zend Engine 2.0的改进
- · 解决RHAS3中Apache2的PHP上传文件大小的限制
- · PHP巧获服务器端信息
- · 利用php和js实现页面数据刷新

