大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> ASP专区 -> 一个ASP写的侧边菜单栏

一个ASP写的侧边菜单栏

时间: 2021-07-31 作者:daque

<% class menus

public title, id, image, titlecolor, target, background, headimage, height, width, bgcolor, styleprivate menuitem, menustr

private sub class_initialize title = "" id = "" menuitem = "" image="" titlecolor = "#000000" target = "_blank" background = "" headimage = "" height = "20" width = "100%" bgcolor = "" style = "" scriptend sub

private sub class_terminate title  = "" id = "" menuitem = ""end sub

public function additem(byval nitem, byval nurl) menuitem = menuitem & "<tr><td style='font-size:12px;' align='left'>    {$image}<a href='" & nurl & "' target='"&target&"' class='"& style &"'>" & nitem & "</a></td></tr>"end function

public sub show() menustr = "<table border=0 width='"& width &"' style='border:1px solid #999999;' bgcolor='"& bgcolor &"'><tr><td height='"& height &"' onclick=menus('" & id & "') bgcolor='"& bgcolor &"' valign='bottom' style='" & _ "font-size:12px;color:"&titlecolor&";cursor: hand;' background='"&background&"' align='left'>  {$headimage}" & title & "</td></tr></table><div id=" & chr(34) & id & chr(34) & " style=" &chr(34) & _ "display:none;"& chr(34) & "><table width=100% border=0 style='border-left:1px solid #999999;border-right:1px solid #999999;border-bottom:1px solid #999999;'>" & menuitem & "</table></div>"  if image<>"" then menustr = replace(menustr, "{$image}", image) else menustr = replace(menustr, "{$image}", "") end if  if headimage<>"" then menustr = replace(menustr, "{$headimage}", headimage) else menustr = replace(menustr, "{$headimage}", "") end if  response.write menustrend sub

private function script() dim jscript  jscript = "<script language="&chr(34)&"javascript"&chr(34)&"type="&chr(34)&"text/javascript"&chr(34)& _">"&vbcrlf&"<!--"&vbcrlf&"function menus(str){"&vbcrlf&"var obj;if (document.getelementbyid(str)){"&vbcrlf& _"obj=document.getelementbyid(str);"& _"if (obj.style.display =="&chr(34)&"none"&chr(34)&"){obj.style.display ="&chr(34)&chr(34)& _";}else{obj.style.display ="&chr(34)&"none"&chr(34)&";}}}//--></script>"  response.write jscriptend function

public sub addnew() title  = "" id = "" menuitem = "" menustr = ""end sub

public sub openitem(byval itemid)

end sub

end class%>

应用本事:<%dim newmenusset newmenus = new menusnewmenus.target = "" '翻创办法newmenus.bgcolor = "#336699" '主标签背场合newmenus.titlecolor = "#ffffff" '主标出面体神色newmenus.height = "10px" '莫斯科大学newmenus.style ="a1" '子标签格局newmenus.width = "100%" '菜单宽窄

newmenus.addnewnewmenus.title = "派系网站"newmenus.id = "menu1"newmenus.additem "网易", "http://www.163.com"newmenus.additem "搜狐", "http://www.sohu.com"newmenus.show

newmenus.addnewnewmenus.title = "局部网站"newmenus.id = "menu2"newmenus.additem "iebsoft studio", "http://iebsoft.512j.com"newmenus.additem "租赁的空间", "http://107814.hxidc.com"newmenus.show

newmenus.addnewnewmenus.title = "网站动静处治"newmenus.id = "menu3"newmenus.additem "动静列表", "#"newmenus.additem "图片动静", "#"newmenus.additem "动静处治", "#"newmenus.show

set newmenus = nothing%>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.