menu.asp
上传用户:xhjd888
上传日期:2022-07-20
资源大小:203k
文件大小:7k
源码类别:

.net编程

开发平台:

Visual Basic

  1. <!--#include file="add/ocdb/ocdb.asp"-->
  2. <style type="text/css">
  3. <!--
  4. /*菜单样式定义*/
  5. #menu{
  6. clear:both;
  7. margin-right: auto;
  8. margin-left: auto;
  9. width:900px;
  10. color:#fff;
  11. background-color:#900;
  12. }
  13. /*主菜单样式定义*/
  14. .mainmenu{
  15. float:left;
  16. width:64px;
  17. font-size:13px;
  18. color:#fff;
  19. border-left:1px solid #E0E0E0;
  20. }
  21. .menucontent{
  22. float:left;
  23. width:80px; 
  24. height:20px;
  25. color:#fff;
  26. padding:5px;
  27. }
  28. /*子菜单样式定义*/
  29. .submenu{
  30. clear:both;
  31. float:left;
  32. position:absolute;
  33. width:80px;
  34. padding:0px;
  35. font-size:13px;
  36. }
  37. .menucontent{
  38. float:left;
  39. width:80px; 
  40. height:20px;
  41. color:#fff;
  42. padding:5px;
  43. }
  44. .MenuItem,.biank {
  45. line-height:24px; 
  46. }
  47. .biank
  48.  {
  49. border-bottom: #ccc 1px dotted; 
  50. }
  51. .biank a:link,a:visited {
  52. color: #333; 
  53. width:100%;
  54. display:block;
  55. background-color:#eee;
  56. text-decoration: none;
  57. }
  58. .biank a:hover
  59.  {
  60.   color: #fff;
  61. width:100%;
  62. background-color:#900;
  63. }
  64. .biank a:hover{
  65. background-color:#900;
  66. }
  67. -->
  68. </style>
  69. <style type="text/css">
  70. .MenuOut
  71. {
  72.    width:100px;
  73.    clear:both;  
  74.    
  75. }
  76. .MenuItem
  77. {
  78.    width:99px;
  79.    float:left;
  80.    height:auto; 
  81.    background-color:#eee;
  82.    color:#000;
  83.    cursor:pointer; 
  84.    /*border-bottom: #ccc 1px dotted;*/ 
  85. }
  86. .MenuItemP
  87. {
  88.    width:100%;
  89.    clear:both;
  90.    height:26px;
  91.    background-color:#eee;
  92. }
  93. .SubMenuItem
  94. {
  95.    width:100px;
  96.    height:auto;
  97.    clear:both;
  98.    background-color:#eee;
  99.    color:#FF0000;
  100.    font-size:12px;
  101.    position:absolute;
  102.    top:0px;
  103.    left:0px;
  104. }
  105. .BRC
  106. {
  107.    clear:both;
  108.    font-size:0px;
  109. }
  110. .SubMenuP
  111. {
  112.    width:1px;
  113.    height:1px;
  114.    font-size:1px;
  115.    float:left;
  116.    position:relative;
  117. }
  118. .SubMenuItem ul
  119. {
  120.    padding:0px;
  121.    margin:0px;
  122. }
  123. .SubMenuItem ul li
  124. {
  125.    list-style:none;
  126.    padding:0px;
  127.    margin:0px;
  128.    
  129. }
  130. </style>
  131. </head>
  132. <body>
  133. <%
  134. '=========================================================
  135. '编程者:www.bbkan8.cn
  136. '=========================================================
  137. dim jiebie_cha,lm_num_cha,lm_num_cha2,s_jibie,jibie_cha,lanmu_xxx,lanmu_nei_xxx
  138. ul_num_cha=0
  139. function tabnum(num)
  140. tabnum=tabnum+chr(9)+chr(9)+chr(9)
  141. for i=0 to num
  142. tabnum=tabnum+chr(9)
  143. next
  144. end function
  145. %>
  146. <div id="topbanner"></div>
  147. <div id="menu">
  148.         <%
  149. dim lanmu_xx
  150. lanmu_xx=1
  151. set rs=conn.execute("select top 5 * from class where cwar=0 order by id desc")
  152.         while not rs.eof
  153. %>
  154. <div class="mainmenu" onMouseOver="submenu<%=lanmu_xx%>.style.display='block'" onMouseOut="submenu<%=lanmu_xx%>.style.display='none'">
  155.      <div class="menucontent"><a href="#"><%=rs("cname")%></a></div></div>
  156.  
  157. <%
  158. lanmu_xx=lanmu_xx+1
  159. rs.movenext
  160. wend
  161. 'end if
  162. rs.close
  163. set rs=nothing
  164. %>  
  165. </div>
  166. <%
  167. dim marginleft
  168. marginleft=0
  169. lanmu_xx=1
  170. lanmu_xxx=1
  171. lanmu_nei_xxx=1
  172. set rs=conn.execute("select top 5 * from class where cwar=0 order by id desc")
  173. while not rs.eof
  174. %>
  175. <div class="submenu" style="display:none;margin-left:<%=marginleft%>px;" onMouseOver="submenu<%=lanmu_xx%>.style.display='block'" onMouseOut="submenu<%=lanmu_xx%>.style.display='none'" id="submenu<%=lanmu_xx%>">
  176.     <div class="MenuOut"> 
  177. <%
  178. sql2="select * from class where csub="&rs("id")&" and cwar<>0 order by csub,lmcd"
  179. set rs2=server.CreateObject("adodb.recordset")
  180. rs2.open sql2,conn,1,3
  181. while not rs2.eof
  182. %>
  183. <%
  184. if lanmu_nei_xxx<>1  and rs2("cwar")>0  then
  185. jibie_cha=rs2("cwar")-s_jibie
  186. if jibie_cha<0 then
  187. for i=1 to jibie_cha*-1
  188. %>
  189.                                                        </ul>
  190.                                                   </div>
  191.                                             </div>
  192.                                         </div>
  193. <%
  194. next
  195. ul_num_cha=ul_num_cha-jibie_cha
  196. 'response.Write("hhh"&int(jibie_cha)*-1&"hhh")
  197. end if
  198. end if
  199. %>
  200. <%
  201. if rs2("cwar")=1 then
  202. if rs2("endclass")=0 then
  203. %>
  204.              <div class="MenuItemP">
  205.               <div class="MenuItem biank" ><a href="#">&nbsp;<%=rs2("cname")%></a></div>
  206.               </div>
  207.   
  208. <%else%>
  209.                 <div class="MenuItemP" onMouseOver="showm('s<%=lanmu_xxx%>');" onMouseOut="hidem('s<%=lanmu_xxx%>');" >
  210.                 <div class="MenuItem biank" ><a href="#">&nbsp;<%=rs2("cname")%> &raquo;</a></div>
  211.                     <div class="SubMenuP">
  212.                           <div class="SubMenuItem"   id="s<%=lanmu_xxx%>" style="display:none;" onMouseOut="hidem('s<%=lanmu_xxx%>');">
  213.                                 <ul>
  214. <%
  215. lm_num_cha=lm_num_cha+1
  216. end if
  217. end if
  218. %>
  219. <%
  220. if rs2("cwar")>1 then
  221. if rs2("endclass")=0 then
  222. %>
  223.              <li><span class="biank" style="width:100%"><a href="#">&nbsp;<%=rs2("cname")%></a></span></li>
  224.   
  225. <%else%>
  226.                 <div class="MenuItemP" onMouseOver="showm('s<%=lanmu_xxx%>');" onMouseOut="hidem('s<%=lanmu_xxx%>');" >
  227.                 <div class="MenuItem biank" ><a href="#">&nbsp;<%=rs2("cname")%> &raquo;</a></div>
  228.                     <div class="SubMenuP">
  229.                           <div class="SubMenuItem"   id="s<%=lanmu_xxx%>" style="display:none;" onMouseOut="hidem('s<%=lanmu_xxx%>');">
  230.                                 <ul>
  231. <%
  232. lm_num_cha=lm_num_cha+1
  233. end if
  234. end if
  235. %>
  236. <%
  237. rs2.movenext
  238. if rs2.eof then
  239. rs2.MovePrevious
  240. jibie_cha=1-rs2("cwar")
  241. if jibie_cha<0 then
  242. for i=1 to jibie_cha*-1
  243. %>
  244.                                                        </ul>
  245.                                                   </div>
  246.                                             </div>
  247.                                         </div>
  248. <%
  249. next
  250. ul_num_cha=ul_num_cha-jibie_cha
  251. 'response.Write("hhh"&int(jibie_cha)*-1&"hhh")
  252. end if
  253. rs2.movenext
  254. end if
  255. rs2.MovePrevious
  256. %>
  257. <%
  258. s_jibie=rs2("cwar")
  259. lanmu_xxx=lanmu_xxx+1
  260. lanmu_nei_xxx=lanmu_nei_xxx+1
  261. rs2.movenext
  262. if rs2.eof then
  263. lanmu_nei_xxx=1
  264. end if
  265. wend
  266. rs2.close
  267. set rs2=nothing
  268.                  
  269. response.Write("<br class=""BRC"" />")                
  270. response.Write("</div>")
  271. response.Write("</div>")
  272. lanmu_xx=lanmu_xx+1
  273. marginleft=marginleft+80
  274. rs.movenext
  275. wend
  276. 'end if
  277. rs.close
  278. set rs=nothing
  279. %>
  280. <script type="text/javascript">
  281. function init(obj,id)
  282. {
  283.    showm(id);
  284.    d=$(id);
  285.    obj.onmouseout = function(e)
  286.    {
  287.     d.style.display="none";
  288.    }
  289.    d.onmouseout = function(e)
  290.    {
  291.     d.style.display="none";
  292.    }
  293. }
  294. function showm(o)
  295. {
  296.    var obj=document.getElementById(o);
  297.    obj.style.display="";
  298. function hidem(o)
  299. {
  300.    var obj=document.getElementById(o);
  301.    obj.style.display="none";
  302. function $( id )
  303. {
  304.    if( typeof(id) == "string" )
  305.     return document.getElementById( id ); 
  306.    return id;
  307. }
  308. </script>