无主之地2命名游戏,猪兔大战中文补丁,三八多面手
<%
rem 文章标题: 利用vbs类实现css按钮
rem 作者:yanek
rem 联系:aspboy@263.net
class cssbutton
public name
public backcolor
public bordercolor
public font
public fontcolor
public width
public text
public url
public mouseovercolor
public function generatestyletag()
'create the style tag
dim strstyle
strstyle = "<style type=""text/css"">" & vbcrlf & _
"<!--" & vbcrlf & _
"#mybutton" & name & " {border-style: inset; " & vbcrlf & _
" border-color: " & bordercolor & ";" & vbcrlf & _
" background-color: " & backcolor & ";" & vbcrlf & _
" width: " & width & ";" & vbcrlf & _
" text-align: center; }" & vbcrlf & vbcrlf & vbcrlf & _
"a.buttontext" & name & " {color: " & fontcolor & "; " & vbcrlf & _
" text-decoration: none; " & vbcrlf & _
" font: " & font & ";" & vbcrlf & _
" cursor: hand; }" & vbcrlf & vbcrlf & vbcrlf & _
".buttonover" & name & " {color: " & mouseovercolor & ";" & vbcrlf & _
" text-decoration: none; " & vbcrlf & _
" font: " & font & ";" & vbcrlf & _
" cursor: hand; }" & vbcrlf & _
" // -->" & vbcrlf & _
"</style>"
generatestyletag = strstyle
end function
public function generatebuttontag()
dim strhtml
strhtml = "<a href=""" & url & """ class=""buttontext" & name & """ " & _
"onmouseover=""this.classname='buttonover" & name & "';"" " & _
"onmouseout=""this.classname='buttontext" & name & "';"">" & _
vbcrlf & "<div id=""mybutton" & name & """>" & vbcrlf & text & vbcrlf & "</div></a>" & vbcrlf
generatebuttontag = strhtml
end function
end class
rem 建立类的实例
dim btnyahoo, btnlycos
set btnyahoo = new cssbutton
set btnlycos = new cssbutton
rem 设置按钮对象的相关属性
btnyahoo.backcolor = "#aaaaaa"
btnyahoo.bordercolor = "#bbbbbb"
btnyahoo.font = "bold 12pt verdana"
btnyahoo.fontcolor = "black"
btnyahoo.width = "80px"
btnyahoo.mouseovercolor = "yellow"
btnyahoo.url = "http://www.yahoo.com/"
btnyahoo.name = "yahoo"
btnyahoo.text = "yahoo!"
rem 调用方法输出按钮
response.write btnyahoo.generatestyletag()
response.write btnyahoo.generatebuttontag()
response.write "<p> </p>"
rem 设置按钮对象的相关属性
btnlycos.backcolor = "#aaaaaa"
btnlycos.bordercolor = "#bbbbbb"
btnlycos.font = "10pt arial"
btnlycos.fontcolor = "black"
btnlycos.width = "70px"
btnlycos.mouseovercolor = "yellow"
btnlycos.url = "http://www.lycos.com/"
btnlycos.name = "lycos"
btnlycos.text = "lycos"
rem 调用方法输出按钮
response.write btnlycos.generatestyletag()
response.write btnlycos.generatebuttontag()
%>
演示:http://www.cnaspol.com/vbsclasscssbutton.asp
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
用vbs实现文本循环读取
因为测试中需要读取一批url数据进行浏览,其实使用qtp本身的table能实现多种读取方式,但是因为需要tabel是使用excel保存的,在没有...
[阅读全文]
-
-
-
-
-
-
-
网友评论