柴火.记得
给我一片天空,让我自由的飞翔;给我一片大地,让我自由的呼吸;人类需要一个共同的目标
众人拾柴,火焰高,发光,发亮,暖人心
博客园
闪存
首页
新随笔
联系
管理
订阅
随笔- 27 文章- 0 评论- 5
鼠标指向提示javascript程序
1
//
定义变量、设置默认值
2
var
LabelFontFace
=
"
宋体,arial,Verdana
"
;
3
var
LabelFontColor
=
"
#000000
"
;
4
var
LabelFontSize
=
"
9pt
"
;
5
var
LabelFontStyle
=
"
Font.PLAIN
"
;
6
var
LabelBorderColor
=
"
#000000
"
;
7
var
LabelBackColor
=
"
#FFFFE1
"
;
8
//
设置各个属性
9
function
SetLabelFontFace(obj)
10
{
11
obj
=
Trim(obj);
12
if
(obj
==
null
||
obj
==
""
[img]
/
images
/
wink.gif[
/
img]
13
{
14
obj
=
"
宋体,arial,Verdana
"
;
15
}
16
LabelFontFace
=
obj;
17
}
18
function
SetLabelFontColor(obj)
19
{
20
obj
=
Trim(obj);
21
if
(obj
==
null
||
obj
==
""
[img]
/
images
/
wink.gif[
/
img]
22
{
23
obj
=
"
#000000
"
;
24
}
25
LabelFontColor
=
obj;
26
}
27
function
SetLabelFontSize(obj)
28
{
29
obj
=
Trim(obj);
30
if
(obj
==
null
||
obj
==
""
[img]
/
images
/
wink.gif[
/
img]
31
{
32
obj
=
"
9pt
"
;
33
}
34
LabelFontSize
=
obj;
35
}
36
function
SetLabelFontStyle(obj)
37
{
38
obj
=
Trim(obj);
39
if
(obj
==
null
||
obj
==
""
[img]
/
images
/
wink.gif[
/
img]
40
{
41
obj
=
"
Font.PLAIN
"
;
42
}
43
LabelFontStyle
=
obj;
44
}
45
46
function
SetLabelBorderColor(obj)
47
{
48
obj
=
Trim(obj);
49
if
(obj
==
null
||
obj
==
""
[img]
/
images
/
wink.gif[
/
img]
50
{
51
obj
=
"
#000000
"
;
52
}
53
LabelBorderColor
=
obj;
54
}
55
56
function
SetLabelBackColor(obj)
57
{
58
obj
=
Trim(obj);
59
if
(obj
==
null
||
obj
==
""
[img]
/
images
/
wink.gif[
/
img]
60
{
61
obj
=
"
#FFFFE1
"
;
62
}
63
LabelBackColor
=
obj;
64
}
65
66
//
合成文字样式
67
function
SetTextStyle(str)
68
{
69
var
strRet
=
""
;
70
var
strStyle
=
""
;
71
strStyle
=
"
font-family:
"
+
LabelFontFace
+
"
;
"
;
72
strStyle
+=
"
color:
"
+
LabelFontColor
+
"
;
"
;
73
strStyle
+=
"
font-size:
"
+
LabelFontSize
+
"
;
"
;
74
switch
(LabelFontStyle.toLowerCase())
75
{
76
case
"
font.plain
"
:
77
strStyle
+=
"
font-weight: normal;
"
;
78
strStyle
+=
"
font-style: normal;
"
;
79
break
;
80
case
"
font.bold
"
:
81
strStyle
+=
"
font-weight: bold;
"
;
82
strStyle
+=
"
font-style: normal;
"
;
83
break
;
84
case
"
font.italic
"
:
85
strStyle
+=
"
font-weight: normal;
"
;
86
strStyle
+=
"
font-style: italic;
"
;
87
break
;
88
case
"
font.italicbold
"
:
89
case
"
font.bolditalic
"
:
90
strStyle
+=
"
font-weight: bold;
"
;
91
strStyle
+=
"
font-style: italic;
"
;
92
break
;
93
default
:
94
strStyle
+=
"
font-weight: bold;
"
;
95
strStyle
+=
"
font-style: italic;
"
;
96
break
;
97
}
98
strRet
=
"
<font style='
"
+
strStyle
+
"
'>
"
;
99
strRet
+=
"
"
+
str
+
"
"
;
100
strRet
+=
"
</font>
"
;
101
return
strRet;
102
}
103
104
//
合成表格样式
105
function
SetTableStyle()
106
{
107
var
strRet
=
""
;
108
strRet
+=
"
border-right:
"
+
LabelBorderColor
+
"
1px solid;
"
;
109
strRet
+=
"
border-top:
"
+
LabelBorderColor
+
"
1px solid;
"
;
110
strRet
+=
"
border-left:
"
+
LabelBorderColor
+
"
1px solid;
"
;
111
strRet
+=
"
border-bottom:
"
+
LabelBorderColor
+
"
1px solid;
"
;
112
strRet
+=
"
background-color:
"
+
LabelBackColor;
113
return
strRet;
114
}
115
116
//
显示提示
117
function
ShowNote(str)
118
{
119
var
strHtml;
120
strHtml
=
""
;
121
strHtml
+=
"
<table height=1px width=1px border='0'cellspacing='0' cellpadding='0' style='
"
+
SetTableStyle()
+
"
'>
"
;
122
strHtml
+=
"
<tr>
"
;
123
strHtml
+=
"
<td>
"
+
SetTextStyle(str)
+
"
</td>
"
;
124
strHtml
+=
"
</tr>
"
;
125
strHtml
+=
"
</table>
"
;
126
if
(document.all
&&
document.readyState
==
"
complete
"
[img]
/
images
/
wink.gif[
/
img]
127
{
128
document.all.div_Note.innerHTML
=
strHtml;
129
document.all.div_Note.style.pixelLeft
=
event.clientX
+
document.body.scrollLeft
+
10
130
document.all.div_Note.style.pixelTop
=
event.clientY
+
document.body.scrollTop
+
10
131
document.all.div_Note.style.visibility
=
"
visible
"
132
}
133
}
134
135
//
隐藏提示
136
function
HideNote()
137
{
138
if
(document.all)
139
{
140
document.all.div_Note.style.visibility
=
"
hidden
"
;
141
}
142
else
143
{
144
if
(document.layers)
145
{
146
clearInterval(currentscroll)
147
document.div_Note.visibility
=
"
hidden
"
;
148
}
149
}
150
}
151
152
//
初始化
153
function
Init()
154
{
155
window.document.write(
"
<div id=\
"
div_Note\
"
style=\
"
VISIBILITY:hidden; POSITION:absolute; HEIGHT:13px;z
-
index:
1
\
"
></div>
"
[img]
/
images
/
wink.gif[
/
img];
156
}
157
Init();
158
159
//
生成提示字符
160
function
ShowLabel(text,note,bclick)
161
{
162
if
(bclick
!=
null
)
163
{
164
return
"
<a href=\
"
#\
"
onMouseOver=\
"
ShowNote('
"
+ note +
"
')\
"
onMouseOut=\
"
HideNote()\
"
onClick=\
"
JavaScript[img]
/
images
/
biggrin.gif[
/
img]oSomeThing(
this
);\
"
>
"
+
text
+
"
</a>
"
;
165
}
166
else
167
{
168
return
"
<a href=\
"
#\
"
onMouseOver=\
"
ShowNote('
"
+ note +
"
')\
"
onMouseOut=\
"
HideNote()\
"
>
"
+
text
+
"
</a>
"
;
169
}
170
}
171
绿色通道:
好文要顶
关注我
收藏该文
与我联系
posted @ 2006-09-18 11:56
柴火
阅读(300)
评论(1)
编辑
收藏
评论
832649
回复
引用
#1楼
2007-07-26 18:45
|
angkor[未注册用户]
好帖
注册用户登录后才能发表评论,请
登录
或
注册
,
返回博客园首页
。
首页
博问
闪存
新闻
园子
招聘
知识库
最新IT新闻
:
·
Twitter联合创始人:长时间用Twitter不利健康
·
盛大文学重启赴美IPO计划拟融资2亿美元
·
谷歌招聘揭秘:入职就像进入美军海豹突击队
·
诺基亚超HTC成第一大Windows Phone手机商
·
Google Voice支持圈子功能:可用于过滤来电
»
更多新闻...
最新知识库文章
:
·
领域模型管理与AOP
·
编程的艺术:漂亮的代码和漂亮的软件
·
GIT分支管理是一门艺术
·
编程:是一门艺术
·
编程是一门艺术吗?
»
更多知识库文章...
China-pub 2011秋季教材巡展
China-Pub 计算机绝版图书按需印刷服务
公告
昵称:
柴火
园龄:
6年3个月
粉丝:
0
关注:
0
<
2006年9月
>
日
一
二
三
四
五
六
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
搜索
常用链接
我的随笔
我的评论
我的参与
最新评论
我的标签
更多链接
随笔分类
(25)
Android
(rss)
C#/VB.Net/Asp.Net(7)
(rss)
C++/软件工程
(rss)
J2EE(1)
(rss)
Java/JavaScript(3)
(rss)
Sql/数据仓库(4)
(rss)
数据结构
(rss)
贴文随笔(5)
(rss)
系统安全/网络工程(5)
(rss)
随笔档案
(27)
2007年11月 (2)
2007年5月 (1)
2006年9月 (13)
2006年7月 (6)
2006年3月 (4)
2005年11月 (1)
柴火推荐站点
GameSpot
sourceforge.net
VeryCD
绵羊日记
(rss)
飘荡软件下载
游侠网
娱乐吧BT论坛
书籍资料网站
netYi专业电脑电子书库
翡翠居
天下书盟
武侠屋
西安信息资源网
中国E书网
音乐网站链接
岷江音乐台
七傲试听
新快音乐
友情blog
ahuiok的专栏
(rss)
备用blog
柴火的情感博客
(rss)
本人的情感博客,欢迎到访!
在线工具
GB2312读音表
扩展名辞典
系统进程查询
新浪天气预报
英汉/汉英词典
在线日历
中文/日文翻译
在线文档
51Windows.Net
CSDN文档中心
CSS2中文手册
J2SE_1.4.2_API
PHP用户手册
VBScript用户手册
网页脚本收藏
最新评论
阅读排行榜
推荐排行榜