This Domain(Admin5.com) is for Sale:

jspSmartUpload上传下载全攻略

时间:2007-10-22  来源:不详  作者:林子

#toolbar {
margin: 0;
padding: 0;
width: 262px;
background: buttonface;
border-top: 1px solid buttonhighlight;
border-left: 1px solid buttonhighlight;
border-bottom: 1px solid buttonshadow;
border-right: 1px solid buttonshadow;
text-align:right;
} 织梦好,好织梦

.button {
background: buttonface;
border: 1px solid buttonface;
margin: 1;
} dedecms.com

.raised {
border-top: 1px solid buttonhighlight;
border-left: 1px solid buttonhighlight;
border-bottom: 1px solid buttonshadow;
border-right: 1px solid buttonshadow;
background: buttonface;
margin: 1;
} 织梦内容管理系统

.pressed {
border-top: 1px solid buttonshadow;
border-left: 1px solid buttonshadow;
border-bottom: 1px solid buttonhighlight;
border-right: 1px solid buttonhighlight;
background: buttonface;
margin: 1;
} 内容来自dedecms


读者可能已经注意到,我们在样式表中使用了三种系统颜色引用:buttonface、buttonshadow和buttonhighlight。通过将buttonface作为工具栏和按钮的背景色,我们可以使用用户得到与其他应用软件相同的界面外观。用buttonshadow和buttonhighlight色创建边界,通过编写简单的javascript函数,就能使按钮具有3D效果。当然,如果想使该GUI更与网站而不是用户的浏览器匹配,可以更换适当的颜色。

copyright dedecms

能够改变按钮样式的javascript下面的四个函数供事件处理程序在改变鼠标事件图像的类名时使用。尽管可以把javascript代码编写成嵌入式的,但我们把它们组织进一个函数中,方便以后添加其他功能。

织梦好,好织梦

function mouseover(el) {
el.className = "raised";
} 织梦好,好织梦

function mouseout(el) {
el.className = "button";
} 内容来自dedecms

function mousedown(el) {
el.className = "pressed";
} dedecms.com

function mouseup(el) {
el.className = "raised";
} 织梦好,好织梦


与HTML进行整合 织梦内容管理系统

现在剩下的工作就是将这些函数与包含工具栏、图像、文本域的HTML代码组合在一起: 织梦好,好织梦


<img class="button"
onmouseover="mouseover(this);"
onmouseout="mouseout(this);"
onmousedown="mousedown(this);"
onmouseup="mouseup(this);"
onclick="format_sel('b');"
src="bold.gif"
width="16" height="16"

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息