vbsクラスによるcssボタンのコードの実現
4358 ワード
rem : vbs css
rem :yanek
rem :[email protected]
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 = ""
GenerateStyleTag = strStyle
End Function
Public Function GenerateButtonTag()
Dim strHTML
strHTML = " "onMouseOver=""this.className='buttonover" & Name & "';"" " & _
"onMouseOut=""this.className='buttontext" & Name & "';"">" & _
vbCrLf & "" & vbCrLf & Text & vbCrLf & "" & 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 "
"
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