js:


1
var ttAbove = false; // tooltip above mousepointer? Alternative: true
2
var ttBgColor = "#e6ecff";
3
var ttBgImg = ""; // path to background image;
4
var ttBorderColor = "#003399";
5
var ttBorderWidth = 1;
6
var ttDelay = 500; // time span until tooltip shows up [milliseconds]
7
var ttFontColor = "#000066";
8
var ttFontFace = "arial,helvetica,sans-serif";
9
var ttFontSize = "11px";
10
var ttFontWeight = "normal"; // alternative: "bold";
11
var ttLeft = false; // tooltip on the left of the mouse? Alternative: true
12
var ttOffsetX = 12; // horizontal offset of left-top corner from mousepointer
13
var ttOffsetY = 15; // vertical offset "
14
var ttOpacity = 100; // opacity of tooltip in percent (must be integer between 0 and 100)
15
var ttPadding = 3; // spacing between border and content
16
var ttShadowColor = "";
17
var ttShadowWidth = 0;
18
var ttStatic = false; // tooltip NOT move with the mouse? Alternative: true
19
var ttSticky = false; // do NOT hide tooltip on mouseout? Alternative: true
20
var ttTemp = 0; // time span after which the tooltip disappears; 0 (zero) means "infinite timespan"
21
var ttTextAlign = "left";
22
var ttTitleColor = "#ffffff"; // color of caption text
23
var ttWidth = 300;
24
//////////////////// END OF TOOLTIP CONFIG ////////////////////////
25
26
27
28
////////////// TAGS WITH TOOLTIP FUNCTIONALITY ////////////////////
29
// List may be extended or shortened:
30
var tt_tags = new Array("a","area","b","big","caption","center","code","dd","div","dl","dt","em","h1","h2","h3","h4","h5","h6","i","img","input","li","map","ol","p","pre","s", "select", "small","span","strike","strong","sub","sup","table","td","th","tr","tt","u","var","ul","layer");
31
/////////////////////////////////////////////////////////////////////
32
33
34
35
///////// DON'T CHANGE ANYTHING BELOW THIS LINE /////////////////////
36
var tt_obj = null, // current tooltip
37
tt_ifrm = null, // iframe to cover windowed controls in IE
38
tt_objW = 0, tt_objH = 0, // width and height of tt_obj
39
tt_objX = 0, tt_objY = 0,
40
tt_offX = 0, tt_offY = 0,
41
xlim = 0, ylim = 0, // right and bottom borders of visible client area
42
tt_sup = false, // true if T_ABOVE cmd
43
tt_sticky = false, // tt_obj sticky?
44
tt_wait = false,
45
tt_act = false, // tooltip visibility flag
46
tt_sub = false, // true while tooltip below mousepointer
47
tt_u = "undefined",
48
tt_mf = null, // stores previous mousemove evthandler
49
// Opera: disable href when hovering <a>
50
tt_tag = null; // stores hovered dom node, href and previous statusbar txt
51
52
53
var tt_db = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null,
54
tt_n = navigator.userAgent.toLowerCase(),
55
tt_nv = navigator.appVersion;
56
// Browser flags
57
var tt_op = !!(window.opera && document.getElementById),
58
tt_op6 = tt_op && !document.defaultView,
59
tt_op7 = tt_op && !tt_op6,
60
tt_ie = tt_n.indexOf("msie") != -1 && document.all && tt_db && !tt_op,
61
tt_ie6 = tt_ie && parseFloat(tt_nv.substring(tt_nv.indexOf("MSIE")+5)) >= 5.5,
62
tt_n4 = (document.layers && typeof document.classes != tt_u),
63
tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != tt_u),
64
tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById;
65
66
function tt_Int(t_x)
67

{
68
var t_y;
69
return isNaN(t_y = parseInt(t_x))? 0 : t_y;
70
}
71
function wzReplace(t_x, t_y)
72

{
73
var t_ret = "",
74
t_str = this,
75
t_xI;
76
while((t_xI = t_str.indexOf(t_x)) != -1)
77
{
78
t_ret += t_str.substring(0, t_xI) + t_y;
79
t_str = t_str.substring(t_xI + t_x.length);
80
}
81
return t_ret+t_str;
82
}
83
String.prototype.wzReplace = wzReplace;
84
function tt_N4Tags(tagtyp, t_d, t_y)
85

{
86
t_d = t_d || document;
87
t_y = t_y || new Array();
88
var t_x = (tagtyp=="a")? t_d.links : t_d.layers;
89
for(var z = t_x.length; z--;) t_y[t_y.length] = t_x[z];
90
for(z = t_d.layers.length; z--;) t_y = tt_N4Tags(tagtyp, t_d.layers[z].document, t_y);
91
return t_y;
92
}
93
function tt_Htm(tt, t_id, txt)
94

{
95
var t_bgc = (typeof tt.T_BGCOLOR != tt_u)? tt.T_BGCOLOR : ttBgColor,
96
t_bgimg = (typeof tt.T_BGIMG != tt_u)? tt.T_BGIMG : ttBgImg,
97
t_bc = (typeof tt.T_BORDERCOLOR != tt_u)? tt.T_BORDERCOLOR : ttBorderColor,
98
t_bw = (typeof tt.T_BORDERWIDTH != tt_u)? tt.T_BORDERWIDTH : ttBorderWidth,
99
t_ff = (typeof tt.T_FONTFACE != tt_u)? tt.T_FONTFACE : ttFontFace,
100
t_fc = (typeof tt.T_FONTCOLOR != tt_u)? tt.T_FONTCOLOR : ttFontColor,
101
t_fsz = (typeof tt.T_FONTSIZE != tt_u)? tt.T_FONTSIZE : ttFontSize,
102
t_fwght = (typeof tt.T_FONTWEIGHT != tt_u)? tt.T_FONTWEIGHT : ttFontWeight,
103
t_opa = (typeof tt.T_OPACITY != tt_u)? tt.T_OPACITY : ttOpacity,
104
t_padd = (typeof tt.T_PADDING != tt_u)? tt.T_PADDING : ttPadding,
105
t_shc = (typeof tt.T_SHADOWCOLOR != tt_u)? tt.T_SHADOWCOLOR : (ttShadowColor || 0),
106
t_shw = (typeof tt.T_SHADOWWIDTH != tt_u)? tt.T_SHADOWWIDTH : (ttShadowWidth || 0),
107
t_algn = (typeof tt.T_TEXTALIGN != tt_u)? tt.T_TEXTALIGN : ttTextAlign,
108
t_tit = (typeof tt.T_TITLE != tt_u)? tt.T_TITLE : "",
109
t_titc = (typeof tt.T_TITLECOLOR != tt_u)? tt.T_TITLECOLOR : ttTitleColor,
110
t_w = (typeof tt.T_WIDTH != tt_u)? tt.T_WIDTH : ttWidth;
111
if(t_shc || t_shw)
112
{
113
t_shc = t_shc || "#cccccc";
114
t_shw = t_shw || 5;
115
}
116
if(tt_n4 && (t_fsz == "10px" || t_fsz == "11px")) t_fsz = "12px";
117
118
var t_optx = (tt_n4? '' : tt_n6? ('-moz-opacity:'+(t_opa/100.0)) : tt_ie? ('filter:Alpha(opacity='+t_opa+')') : ('opacity:'+(t_opa/100.0))) + ';';
119
var t_y = '<div id="'+t_id+'" style="position:absolute;z-index:1010;';
120
t_y += 'left:0px;top:0px;width:'+(t_w+t_shw)+'px;visibility:'+(tt_n4? 'hide' : 'hidden')+';'+t_optx+'">' +
121
'<table border="0" cellpadding="0" cellspacing="0"'+(t_bc? (' bgcolor="'+t_bc+'" style="background:'+t_bc+';"') : '')+' width="'+t_w+'">';
122
if(t_tit)
123
{
124
t_y += '<tr><td style="padding-left:3px;padding-right:3px;" align="'+t_algn+'"><font color="'+t_titc+'" face="'+t_ff+'" ' +
125
'style="color:'+t_titc+';font-family:'+t_ff+';font-size:'+t_fsz+';"><b>' +
126
(tt_n4? ' ' : '')+t_tit+'</b></font></td></tr>';
127
}
128
t_y += '<tr><td><table border="0" cellpadding="'+t_padd+'" cellspacing="'+t_bw+'" width="100%">' +
129
'<tr><td'+(t_bgc? (' bgcolor="'+t_bgc+'"') : '')+(t_bgimg? ' background="'+t_bgimg+'"' : '')+' style="text-align:'+t_algn+';';
130
if(tt_n6) t_y += 'padding:'+t_padd+'px;';
131
t_y += '" align="'+t_algn+'"><font color="'+t_fc+'" face="'+t_ff+'"' +
132
' style="color:'+t_fc+';font-family:'+t_ff+';font-size:'+t_fsz+';font-weight:'+t_fwght+';">';
133
if(t_fwght == 'bold') t_y += '<b>';
134
t_y += txt;
135
if(t_fwght == 'bold') t_y += '</b>';
136
t_y += '</font></td></tr></table></td></tr></table>';
137
if(t_shw)
138
{
139
var t_spct = Math.round(t_shw*1.3);
140
if(tt_n4)
141
{
142
t_y += '<layer bgcolor="'+t_shc+'" left="'+t_w+'" top="'+t_spct+'" width="'+t_shw+'" height="0"></layer>' +
143
'<layer bgcolor="'+t_shc+'" left="'+t_spct+'" align="bottom" width="'+(t_w-t_spct)+'" height="'+t_shw+'"></layer>';
144
}
145
else
146
{
147
t_optx = tt_n6? '-moz-opacity:0.85;' : tt_ie? 'filter:Alpha(opacity=85);' : 'opacity:0.85;';
148
t_y += '<div id="'+t_id+'R" style="position:absolute;background:'+t_shc+';left:'+t_w+'px;top:'+t_spct+'px;width:'+t_shw+'px;height:1px;overflow:hidden;'+t_optx+'"></div>' +
149
'<div style="position:relative;background:'+t_shc+';left:'+t_spct+'px;top:0px;width:'+(t_w-t_spct)+'px;height:'+t_shw+'px;overflow:hidden;'+t_optx+'"></div>';
150
}
151
}
152
return(t_y+'</div>' +
153
(tt_ie6 ? '<iframe id="TTiEiFrM" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>' : ''));
154
}
155
function tt_EvX(t_e)
156

{
157
var t_y = tt_Int(t_e.pageX || t_e.clientX || 0) +
158
tt_Int(tt_ie? tt_db.scrollLeft : 0) +
159
tt_offX;
160
if(t_y > xlim) t_y = xlim;
161
var t_scr = tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0);
162
if(t_y < t_scr) t_y = t_scr;
163
return t_y;
164
}
165
function tt_EvY(t_e)
166

{
167
var t_y = tt_Int(t_e.pageY || t_e.clientY || 0) +
168
tt_Int(tt_ie? tt_db.scrollTop : 0);
169
if(tt_sup) t_y -= (tt_objH + tt_offY - 15);
170
else if(t_y > ylim || !tt_sub && t_y > ylim-24)
171
{
172
t_y -= (tt_objH + 5);
173
tt_sub = false;
174
}
175
else
176
{
177
t_y += tt_offY;
178
tt_sub = true;
179
}
180
return t_y;
181
}
182
function tt_ReleasMov()
183

{
184
if(document.onmousemove == tt_Move)
185
{
186
if(!tt_mf && document.releaseEvents) document.releaseEvents(Event.MOUSEMOVE);
187
document.onmousemove = tt_mf;
188
}
189
}
190
function tt_ShowIfrm(t_x)
191

{
192
if(!tt_obj || !tt_ifrm) return;
193
if(t_x)
194
{
195
tt_ifrm.style.width = tt_objW+'px';
196
tt_ifrm.style.height = tt_objH+'px';
197
tt_ifrm.style.display = "block";
198
}
199
else tt_ifrm.style.display = "none";
200
}
201
function tt_GetDiv(t_id)
202

{
203
return(
204
tt_n4? (document.layers[t_id] || null)
205
: tt_ie? (document.all[t_id] || null)
206
: (document.getElementById(t_id) || null)
207
);
208
}
209
function tt_GetDivW()
210

{
211
return tt_Int(
212
tt_n4? tt_obj.clip.width
213
: (tt_obj.style.pixelWidth || tt_obj.offsetWidth)
214
);
215
}
216
function tt_GetDivH()
217

{
218
return tt_Int(
219
tt_n4? tt_obj.clip.height
220
: (tt_obj.style.pixelHeight || tt_obj.offsetHeight)
221
);
222
}
223
224
// Compat with DragDrop Lib: Ensure that z-index of tooltip is lifted beyond toplevel dragdrop element
225
function tt_SetDivZ()
226

{
227
var t_i = tt_obj.style || tt_obj;
228
if(t_i)
229
{
230
if(window.dd && dd.z)
231
t_i.zIndex = Math.max(dd.z+1, t_i.zIndex);
232
if(tt_ifrm) tt_ifrm.style.zIndex = t_i.zIndex-1;
233
}
234
}
235
function tt_SetDivPos(t_x, t_y)
236

{
237
var t_i = tt_obj.style || tt_obj;
238
var t_px = (tt_op6 || tt_n4)? '' : 'px';
239
t_i.left = (tt_objX = t_x) + t_px;
240
t_i.top = (tt_objY = t_y) + t_px;
241
if(tt_ifrm)
242
{
243
tt_ifrm.style.left = t_i.left;
244
tt_ifrm.style.top = t_i.top;
245
}
246
}
247
function tt_ShowDiv(t_x)
248

{
249
tt_ShowIfrm(t_x);
250
if(tt_n4) tt_obj.visibility = t_x? 'show' : 'hide';
251
else tt_obj.style.visibility = t_x? 'visible' : 'hidden';
252
tt_act = t_x;
253
}
254
function tt_OpDeHref(t_e)
255

{
256
var t_tag;
257
if(t_e)
258
{
259
t_tag = t_e.target;
260
while(t_tag)
261
{
262
if(t_tag.hasAttribute("href"))
263
{
264
tt_tag = t_tag
265
tt_tag.t_href = tt_tag.getAttribute("href");
266
tt_tag.removeAttribute("href");
267
tt_tag.style.cursor = "hand";
268
tt_tag.onmousedown = tt_OpReHref;
269
tt_tag.stats = window.status;
270
window.status = tt_tag.t_href;
271
break;
272
}
273
t_tag = t_tag.parentElement;
274
}
275
}
276
}
277
function tt_OpReHref()
278

{
279
if(tt_tag)
280
{
281
tt_tag.setAttribute("href", tt_tag.t_href);
282
window.status = tt_tag.stats;
283
tt_tag = null;
284
}
285
}
286
function tt_Show(t_e, t_id, t_sup, t_delay, t_fix, t_left, t_offx, t_offy, t_static, t_sticky, t_temp)
287

{
288
if(tt_obj) tt_Hide();
289
tt_mf = document.onmousemove || null;
290
if(window.dd && (window.DRAG && tt_mf == DRAG || window.RESIZE && tt_mf == RESIZE)) return;
291
var t_sh, t_h;
292
293
tt_obj = tt_GetDiv(t_id);
294
if(tt_obj)
295
{
296
t_e = t_e || window.event;
297
tt_sub = !(tt_sup = t_sup);
298
tt_sticky = t_sticky;
299
tt_objW = tt_GetDivW();
300
tt_objH = tt_GetDivH();
301
tt_offX = t_left? -(tt_objW+t_offx) : t_offx;
302
tt_offY = t_offy;
303
if(tt_op7) tt_OpDeHref(t_e);
304
if(tt_n4)
305
{
306
if(tt_obj.document.layers.length)
307
{
308
t_sh = tt_obj.document.layers[0];
309
t_sh.clip.height = tt_objH - Math.round(t_sh.clip.width*1.3);
310
}
311
}
312
else
313
{
314
t_sh = tt_GetDiv(t_id+'R');
315
if(t_sh)
316
{
317
t_h = tt_objH - tt_Int(t_sh.style.pixelTop || t_sh.style.top || 0);
318
if(typeof t_sh.style.pixelHeight != tt_u) t_sh.style.pixelHeight = t_h;
319
else t_sh.style.height = t_h+'px';
320
}
321
}
322
323
xlim = tt_Int((tt_db && tt_db.clientWidth)? tt_db.clientWidth : window.innerWidth) +
324
tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0) -
325
tt_objW -
326
(tt_n4? 21 : 0);
327
ylim = tt_Int(window.innerHeight || tt_db.clientHeight) +
328
tt_Int(window.pageYOffset || (tt_db? tt_db.scrollTop : 0) || 0) -
329
tt_objH - tt_offY;
330
331
tt_SetDivZ();
332
if(t_fix) tt_SetDivPos(tt_Int((t_fix = t_fix.split(','))[0]), tt_Int(t_fix[1]));
333
else tt_SetDivPos(tt_EvX(t_e), tt_EvY(t_e));
334
335
var t_txt = 'tt_ShowDiv(\'true\');';
336
if(t_sticky) t_txt += '
{'+
337
'tt_ReleasMov();'+
338
'window.tt_upFunc = document.onmouseup || null;'+
339
'if(document.captureEvents) document.captureEvents(Event.MOUSEUP);'+
340
'document.onmouseup = new Function("window.setTimeout(\'tt_Hide();\', 10);");'+
341
'}';
342
else if(t_static) t_txt += 'tt_ReleasMov();';
343
if(t_temp > 0) t_txt += 'window.tt_rtm = window.setTimeout(\'tt_sticky = false; tt_Hide();\','+t_temp+');';
344
window.tt_rdl = window.setTimeout(t_txt, t_delay);
345
346
if(!t_fix)
347
{
348
if(document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
349
document.onmousemove = tt_Move;
350
}
351
}
352
}
353
var tt_area = false;
354
function tt_Move(t_ev)
355

{
356
if(!tt_obj) return;
357
if(tt_n6 || tt_w3c)
358
{
359
if(tt_wait) return;
360
tt_wait = true;
361
setTimeout('tt_wait = false;', 5);
362
}
363
var t_e = t_ev || window.event;
364
tt_SetDivPos(tt_EvX(t_e), tt_EvY(t_e));
365
if(tt_op6)
366
{
367
if(tt_area && t_e.target.tagName != 'AREA') tt_Hide();
368
else if(t_e.target.tagName == 'AREA') tt_area = true;
369
}
370
}
371
function tt_Hide()
372

{
373
if(window.tt_obj)
374
{
375
if(window.tt_rdl) window.clearTimeout(tt_rdl);
376
if(!tt_sticky || !tt_act)
377
{
378
if(window.tt_rtm) window.clearTimeout(tt_rtm);
379
tt_ShowDiv(false);
380
tt_SetDivPos(-tt_objW, -tt_objH);
381
tt_obj = null;
382
if(typeof window.tt_upFunc != tt_u) document.onmouseup = window.tt_upFunc;
383
}
384
tt_sticky = false;
385
if(tt_op6 && tt_area) tt_area = false;
386
tt_ReleasMov();
387
if(tt_op7) tt_OpReHref();
388
}
389
}
390
function tt_Init()
391

{
392
if(!(tt_op || tt_n4 || tt_n6 || tt_ie || tt_w3c)) return;
393
394
var htm = tt_n4? '<div style="position:absolute;"></div>' : '',
395
tags,
396
t_tj,
397
over,
398
esc = 'return escape(';
399
var i = tt_tags.length; while(i--)
400
{
401
tags = tt_ie? (document.all.tags(tt_tags[i]) || 1)
402
: document.getElementsByTagName? (document.getElementsByTagName(tt_tags[i]) || 1)
403
: (!tt_n4 && tt_tags[i]=="a")? document.links
404
: 1;
405
if(tt_n4 && (tt_tags[i] == "a" || tt_tags[i] == "layer")) tags = tt_N4Tags(tt_tags[i]);
406
var j = tags.length; while(j--)
407
{
408
if(typeof (t_tj = tags[j]).onmouseover == "function" && t_tj.onmouseover.toString().indexOf(esc) != -1 && !tt_n6 || tt_n6 && (over = t_tj.getAttribute("onmouseover")) && over.indexOf(esc) != -1)
409
{
410
if(over) t_tj.onmouseover = new Function(over);
411
var txt = unescape(t_tj.onmouseover());
412
htm += tt_Htm(
413
t_tj,
414
"tOoLtIp"+i+""+j,
415
txt.wzReplace("& ","&")
416
);
417
418
t_tj.onmouseover = new Function('e',
419
'tt_Show(e,'+
420
'"tOoLtIp' +i+''+j+ '",'+
421
((typeof t_tj.T_ABOVE != tt_u)? t_tj.T_ABOVE : ttAbove)+','+
422
((typeof t_tj.T_DELAY != tt_u)? t_tj.T_DELAY : ttDelay)+','+
423
((typeof t_tj.T_FIX != tt_u)? '"'+t_tj.T_FIX+'"' : '""')+','+
424
((typeof t_tj.T_LEFT != tt_u)? t_tj.T_LEFT : ttLeft)+','+
425
((typeof t_tj.T_OFFSETX != tt_u)? t_tj.T_OFFSETX : ttOffsetX)+','+
426
((typeof t_tj.T_OFFSETY != tt_u)? t_tj.T_OFFSETY : ttOffsetY)+','+
427
((typeof t_tj.T_STATIC != tt_u)? t_tj.T_STATIC : ttStatic)+','+
428
((typeof t_tj.T_STICKY != tt_u)? t_tj.T_STICKY : ttSticky)+','+
429
((typeof t_tj.T_TEMP != tt_u)? t_tj.T_TEMP : ttTemp)+
430
');'
431
);
432
t_tj.onmouseout = tt_Hide;
433
if(t_tj.alt) t_tj.alt = "";
434
if(t_tj.title) t_tj.title = "";
435
}
436
}
437
}
438
document.write(htm);
439
if(document.getElementById) tt_ifrm = document.getElementById("TTiEiFrM");
440
}
441
tt_Init();
442
doc:
javascript DHTML,ToolTips,~ javacscript 跨浏览器API
此API中ToolTips的内容可以是普通文本也可以是HTML:例如image。。
特性:
几乎在所有的HTML元素上都可以呈现tooltip,只需要“onmouseover”,但是“onmouseout”不是必须的。
你可以随心所欲地在"onmouseover"中加入函数,来使您的tooltip更加个性化;
实用性:
除了一些极少数的浏览器,主流的浏览器都对其进行了支持Netscape 4, Gecko Browsers, IE 4, 5.0, 5.5 und 6.0, Opera 5, 6, 7 :
用法:
1: <script language="JavaScript" type="text/javascript" src="wz_tooltip.js"></script>
2: <a href="index.htm" onmouseover="return escape('Some text')">Homepage </a>
注:在 onmouseover这个属性中,填入的文本遵循以下规则:必须使用实体,即:"=“; 特别注意
以下三种情况:& amp; == &| & lt; == <(<); | & gt; == >(>);
3: Right: <a href="index.htm" onmouseover="return escape('Text with <img src=\'image.jpg\' width=\'60\'> image.')"> Homepage</a>
Wrong: <a href="index.htm" onmouseover="return escape('Text with <img src="image.jpg" width="60">image.')"> Homepage</a>
扩展功能:
onmouseover="return escape(text1);"也可以这样调用: onmouseover="return escape(TooltipText());就是说可以传递函数指针;
变量和函数必须包含在<body></body>中.并且在你最后一个需要用tooltip的Element之后!
下面这些函数可能会被传递给onmouseover:
Command
|
Effect
|
Example
|
This.T_ABOVE
|
把tooltip放在鼠标的point上,同时this.T_OFFSETY 可以设置竖直方向上的偏移;
|
This.T_ABOVE=true;
|
This.T_BGCOLOR
|
Tooltip的背景颜色,必须用单引号括起来;
|
This.T_BGCOLOR=’#D3E3f6’;
|
This.T_BGIMG
|
Tooltip的背景图象;
|
this.T_BGIMG = ‘myimg.jpg’;
|
This.T_BORDERWIDTH
|
Tooltip 的边缘宽度,如果为0 ,则隐藏
|
this.T_BORDERWIDTH = 3 ;
|
This.T_DELAY
|
Tooltip 显示的延迟时间;
|
this.T_DELAY = 4000;
|
This.T_FIX
|
把tooltip锁定在方括号指定的xy坐标上;
|
this.T_FIX = [200,300];
|
This.T_FONTCOLOR
|
Tooltip的字体颜色
|
This.T_FONTCOLOR=”#993399”;
|
This.T_FONTFACE
|
Tooltip的字体
|
this.T_FONTFACE =’verdana,Geneva’;
|
This.T_FONTSIZE
|
Tooltip字体的大小
|
this.T_FONTSIZE=’30px’
|
This.T_FONTWEIGHT
|
重量 可用的值:‘normal’或者‘bold’;
|
this.T_FONTWEIGHT=’bold’
|
This.T_LEFT
|
Tooltip 是否在鼠标point的上方 值:true;
|
this.T_LEFT=true;
|
This.T_OFFSETX
|
以鼠标为基准,tooltip在水平方向的偏移量
|
this.T_OFFSETX = 32;
|
This.T_OFFSETY
|
以鼠标为基准,tooltip在竖直方向上的偏移量
|
this.T_OFFSETY = 32;
|
This.T_OPACITY
|
属性在OPERA中不支持,取值在0—100之间
|
this.T_OPACITY = 80;
|
This.T_PADDING
|
内间距:内容与边界的space
|
this.T_PADDING = 5;
|
This.T_SHADOWCOLOR
|
自动生成阴影,阴影的strength被自动设置成5px
|
this.T_SHADOWCOLOR = ‘CCAACC’
|
This.T_SHADOWWIDTH
|
阴影的宽度;
|
this.T_SHADOWWIDTH = 8;
|
This.T_STATIC
|
很想操作系统中的tooltip,不跟随鼠标;
|
this.T_STATIC = true;
|
This.T_STICKY
|
Tooltip停留在鼠标初始位置,不跟随鼠标
|
this.T_STICKY = true;
|
This.T_TEMP
|
设置一个时间间隔,第一次tooltip消失到第二次出现
|
this.T_TEMP = 3500;
|
This.T_TITLE
|
标题
|
this.T_TITLE = ‘sometiel’;
|
This.T_TITLECOLOR
|
标题颜色
|
This.T_TITLE=#ff6666’;
|
This.T_WIDTH
|
Tooltip 的宽度
|
this.T_TITLE = 200;
|
This.T_TEXTALIGN
|
对齐方式;取值为: rigtht, justify,left
|
This.T_REXTALIGN = ‘right’
|
<a href="index.htm" onmouseover="this.T_WIDTH=200;this.T_FONTCOLOR='#003399';return escape('Blablah')"> Homepage</a>