A side menu bar written by ASP

Source: Internet
Author: User

The

code is as follows

<% class Menuspublic Title, ID, Image, Titlecolor, Target, Background, Headimage, Height, Width, Bgcolor, styleprivate MenuItem, menustrprivate Sub class_initialize Title = "" "ID =" "MenuItem =" "image=" "Titlecolor =" #000000 "Target =" _ Blank "Background =" "Headimage =" "Height =" "Width =" 100% "Bgcolor =" "Style =" "Scriptend subprivate Sub Class_ Terminate Title = "" "ID =" "MenuItem =" "End subpublic Function AddItem (Byval nitem, Byval nurl) MenuItem = MenuItem &am P "<tr><td style= ' font-size:12px; ' align= ' left ' > {$Image}<a href= '" & Nurl & "' target= '" &targ et& "' class= '" & Style & ">" & Nitem & "</a></td></tr>" End functionpublic Sub  Show () menustr = "<table border=0 width= '" & Width & "' style= ' border:1px solid #999999; ' bgcolor= '" & bgcolor & ' ><tr><td height= ' & Height & ' Onclick=menus (' & ID & ') bgcolor= ' "& bgcolor &am p; "' valign= ' bottom ' stylE= ' "& _" Font-size:12px;color: "&TitleColor&"; cursor:hand; ' background= ' "&Background&" ' align= ' Left ' > {$HeadImage} ' & Title & ' </td></tr></table><p id= ' & chr & ID & CH R (style=) & "&AMP;CHR" & _ "Display:none;" & Chr & "><table width=100% border=0 style= ' border-left:1px solid #999999; border-right:1px Solid # 999999;border-bottom:1px solid #999999; ' > "& MenuItem &" </table></p> "if Image<>" "Then Menustr = replace (Menustr," {$Image} ", Image else Menustr = replace (Menustr, "{$Image}", "") End If If headimage<> "then Menustr = replace (Menustr," {$HeadIma GE} ", headimage) Else Menustr = replace (Menustr," {$HeadImage} "," ") End If Response.Write menustrend SubPrivate Function Script () Dim jscript JScript = "<script language=" &AMP;CHR & "JavaScript" &AMP;CHR (type= &chr) & & "Text/javascript" &AMP;CHR & _ ">" &vbcrlf& "<!--"&vbcrlf&" function menus (str) {"&vbcrlf&" var obj;if (document.getElementById (str)) {"& vbcrlf& _ "Obj=document.getelementbyid (str);" & _ "If" (Obj.style.display = = "&AMP;CHR" & "None" &chr () & ") {Obj.style.display =" &AMP;CHR "& Chr & _ ";} Else{obj.style.display = "&AMP;CHR" & "None" &chr & ";}}} --></script> "Response. Write Jscriptend functionpublic Sub AddNew () Title = "" "ID =" "MenuItem =" "Menustr =" "End subpublic Sub OpenItem (Byva L ItemID) End SubEnd class%>



How to use:

<%dim Newmenusset Newmenus = new Menusnewmenus.target = "" "Open mode Newmenus.bgcolor =" #336699 "' main label background color Newmenus.titlecolo r = "#FFFFFF" ' main label font color newmenus.height = ' 10px ' height newmenus.style = ' A1 ' Sub-label style newmenus.width = ' 100% ' menu width newmenus.addnew Newmenus.title = "portal site" newmenus.id = "menu1" Newmenus.additem "NetEase", "http://www.163.com" Newmenus.additem "Sohu", "http// www.sohu.com "NewMenus.ShowNewMenus.AddNewNewMenus.Title =" personal site "newmenus.id =" menu2 "Newmenus.additem" Iebsoft Studio "," http://iebsoft.512j.com "Newmenus.additem" Rented Space "," http://107814.hxidc.com " NewMenus.ShowNewMenus.AddNewNewMenus.Title = "Site news management" newmenus.id = "Menu3" Newmenus.additem "News list", "#" Newmenus.additem "Picture News", "#" Newmenus.additem "News Management", "#" Newmenus.showset Newmenus = nothing%>


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.