本文根据网上的一篇文章加工而成的
1.建一个js文件(tooltip.js)
//--初始化变量--
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)
{
toolTip

本文介绍了在ASP.NET中自定义Tooltip的显示方法,包括创建js文件、在aspx页面中引入和设置样式,以及在aspx.cs代码文件中添加相应事件处理。同时,文章还提及了如何保护JS文件,防止客户端直接下载,通过在IIS配置中限制对.js文件的访问。
最低0.47元/天 解锁文章
1253

被折叠的 条评论
为什么被折叠?



