发布 shawl.qiu Javascript 智能无限级导航菜单类 Menu class v1.0

来源:互联网 发布:电脑淘宝怎么货到付款 编辑:程序博客网 时间:2024/04/30 14:25

发布 shawl.qiu Javascript 智能无限级导航菜单类 Menu class v1.0


说明:
导航菜单...这个东西每个站点, 大大小小都有嘛.
不过每次写这个基本上都是重新码一遍代码, 很烦是吧, 对, 真的很烦.
那么, 本类可以解决您的烦恼了.

只要调用一下再设置一下就Ok, 而且你可以在一个页面使用本类显示N个菜单, 本类的特点是把各个设置都细分成小功能, 因此可以无限多兼容.

菜单内容格式为:
 id列间隔符,str列间隔符,...列间隔符...
如:
23##海纳百川##12##办公软件##@


一般使用 sql 视图获取和设置菜单字串格式, 也就是 join 表.
如:
  1. SELECT a.cat1id, a.cat1, b.cat2id, b.cat2, c.cat3id, c.cat3
  2. FROM (sqCat1 AS a LEFT JOIN sqCat2 AS b ON a.cat1id=b.cat1id) LEFT JOIN sqCat3 AS c ON b.cat2id=c.cat2id
  3. ORDER BY a.cat1OdrH, a.cat1id, b.cat2OdrH, b.cat2id, c.cat3OdrH, c.cat3id;

如果是使用 asp, 可以使用 Ado RecordSet GetString 快速获取, 见 调用演示.

如果使用 aspx , 也可以用 Ado RecordSet GetString 获取内容, 不过比较麻烦, 请参见鄙人以前的文章:
asp.net 中 使用 ado 的 Recordset GetString  函数 By shawl.qiu
http://blog.csdn.net/btbtd/archive/2007/03/04/1520102.aspx

嗯, 本类有点复杂, 但是调用很简单.
有什么不明白的, 看调用演示, 因为调用演示已经把一切都表述得非常非常清楚.

目录:
1. 调用演示
2. Menu class 核心源码

shawl.qiu
2007-05-21
http://blog.csdn.net/btbtd

下载: http://shawl.qiu.googlepages.com/sq_js_class_Menu_v1.0.7z
演示: http://shawl.qiu.googlepages.com/Menu_1.0_demo.htm

内容:

1. 调用演示

  1. shawl.qiu framework javascript client-side

  2. 类 Menu 

  3. ---/------------------------------------------------------------------------------

  4. 目录:

  5. 0. 数据查询语句

  6. 0.1 二级分类
  7. 0.1.1 查询名
  8. 0.1.2 查询串

  9. 0.2 三级分类
  10. 0.2.1 查询名
  11. 0.2.2 查询串

  12. 1. 调用
  13. 1.1 调用 1
  14. 1.2 调用 2 (Vbscript)
  15. 1.3 调用 3 (Jscript)

  16. 2. 演示
  17. 2.1 动态水平垂直显示菜单演示
  18. ---/---------------------------------------

  19. 内容:

  20. 0. 数据查询语句

  21. 0.1 二级分类

  22. 0.1.1 查询名
  23. v_news_cat

  24. 0.1.2 查询串
  25. SELECT a.classid, a.class, b.nclassid, b.nclass
  26. FROM ctclass AS a INNER JOIN ctnclass AS b ON a.classid=b.classid
  27. ORDER BY a.classorder, a.classid, b.nclassorder;


  28. 0.2 三级分类

  29. 0.2.1 查询名
  30. v_cat_query_3tbl

  31. 0.2.2 查询串
  32. SELECT a.cat1id, a.cat1, b.cat2id, b.cat2, c.cat3id, c.cat3
  33. FROM (sqCat1 AS a LEFT JOIN sqCat2 AS b ON a.cat1id=b.cat1id) LEFT JOIN sqCat3 AS c ON b.cat2id=c.cat2id
  34. ORDER BY a.cat1OdrH, a.cat1id, b.cat2OdrH, b.cat2id, c.cat3OdrH, c.cat3id;


  35. 1. 调用
  36. 1.1 调用 1
  37. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  38. <html xmlns="http://www.w3.org/1999/xhtml">
  39. <!-- DW6 -->
  40. <head>
  41. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  42. <title>shawl.qiu template</title>
  43. </head>
  44. <body>

  45.  <div id="MenuBar">&nbsp;</div>
  46. <script type='text/javascript' src='/sqFwJsCs/default.js'></script>
  47. <script type="text/javascript">
  48. //<![CDATA[
  49.  im.go('UI.Menu');
  50.  //im.help('UI.Menu');
  51.  /*--------------------------end sqFwJsCs----------------------------------*/
  52. //]]>
  53. </script>
  54. <script type="text/javascript">
  55. //<![CDATA[

  56.  var MenuStr3 = 
  57.  "1##JScript##1##函数库##2##文件##@1##JScript##1##函数库##3##测试##@1##JScript##4##类库##6##数据操作##@1##JScript##9##prototype库######@1##JScript##16##模板库######@1##JScript##8##杂类######@1##JScript##14##函数收藏######@5##JavaScript##39##枚举######@5##JavaScript##41##收藏######@5##JavaScript##12##函数库######@5##JavaScript##11##类库######@5##JavaScript##7##小工具######@7##VBScript##10##类库######@7##VBScript##18##函数库##7##文件函数##@15##ActionScript##34##函数库######@15##ActionScript##35##类库######@12##CSharp .Net##23##函数库##9##文件操作##@12##CSharp .Net##23##函数库##10##数据操作##@12##CSharp .Net##31##函数收藏######@12##CSharp .Net##29##控件库######@12##CSharp .Net##24##static 库######@12##CSharp .Net##22##类库######@12##CSharp .Net##32##名称空间######@12##CSharp .Net##40##开发小工具######@12##CSharp .Net##38##杂类######@12##CSharp .Net##27##模板库##8##数据绑定##@12##CSharp .Net##27##模板库##11##aspx 页模板##@12##CSharp .Net##27##模板库##12##ascx 页模板##@11##JScript .Net##20##函数库######@11##JScript .Net##21##类库######@10##Sql##15##Access######@10##Sql##33##MsSql######@10##Sql##36##数据表模板######@13##xhtml##25##普通应用######@14##xml##28##模板库######@9##CSS##13##导航######@9##CSS##17##模板库######@16##Utility##37##Server######@8##测试类##########@"
  58.  ;
  59.  
  60.  var menu = new Menu();
  61.   menu.Debug.Bool = false;
  62.   
  63. //    menu.String = MenuStr2;
  64.   menu.String = MenuStr3;
  65.   menu.Main.ID = "MenuBar";
  66.   
  67.   menu.Direction.Horizontal.Bool = true;
  68.   menu.Direction.Horizontal.Main.Width = "99.5%";
  69. //    menu.Direction.Vertical.Bool = true;
  70.   

  71.   menu.Symbol.Item = "##";
  72.   menu.Symbol.Column = "##@";
  73.   
  74.   //function fAddLink(sLink, bInherit)
  75.   menu.Link.Add("?level1=", false);
  76.   menu.Link.Add("&level2=", true);
  77.   menu.Link.Add("&level3=", true);
  78.   
  79.   //function fAddLinkhighlight(sQuery, sBgColor, sFgColor)
  80.   menu.Query.Highlight.Add("level1", "black", "white");
  81.   menu.Query.Highlight.Add("level2", "brown", "white");
  82.   menu.Query.Highlight.Add("level3", "red", "white");
  83.   
  84.   menu.Go();
  85.   menu = null;

  86. //]]>
  87. </script>
  88. </body>
  89. </html>

  90.  
  91. 1.2 调用 2 (Vbscript)
  92.  
  93. <div id="MenuBar">&nbsp;</div>
  94. <%
  95.  dim MyMenuStr 
  96.  MyMenuStr = fGetString1("select * from v_news_cat", conn)
  97.  
  98.  'Response.write("var str='"&MyMenuStr&"'"&chr(13))
  99.  
  100.  function fGetString1(sQuery, sConn)
  101.    fGetString1 = fGetString(sQuery, sConn, -1, "##", "##@", "empty...")
  102.  end function
  103.  
  104.  function fGetString(sQuery, sConn, iRos, sColDelimeter, sRowDelimeter, sNull)
  105.   dim str, Rs
  106.   set Rs = CreateObject("adodb.recordset")
  107.    Rs.Open sQuery, sConn, 1
  108.    str = rs.GetString(2, iRos, sColDelimeter, sRowDelimeter, sNull)
  109.    Rs.Close
  110.   set Rs = Nothing
  111.   fGetString = str
  112.  end function
  113. %>
  114.  
  115. <script type='text/javascript' src='/sqFwJsCs/default.js'></script>
  116. <script type="text/javascript">
  117. //<![CDATA[
  118.  im.go('UI.Menu');
  119.  //im.help('UI.Menu');
  120.  /*--------------------------end sqFwJsCs----------------------------------*/
  121. //]]>
  122. </script>
  123. <script type="text/javascript">
  124. //<![CDATA[

  125.  var MenuStr2 = 
  126.  "<%Response.Write(MyMenuStr)%>"
  127.  ;
  128.  
  129.  var menu = new Menu();
  130.   menu.Debug.Bool = false;
  131.   
  132.     menu.String = MenuStr2;
  133. //  menu.String = MenuStr3;
  134.   menu.Main.ID = "MenuBar";
  135.   
  136.   menu.Direction.Horizontal.Bool = true;
  137.   //menu.Direction.Vertical.Bool = true;
  138.   
  139.   menu.Direction.Horizontal.Main.Width = "99.5%";
  140.   
  141.   menu.Symbol.Item = "##";
  142.   menu.Symbol.Column = "##@";
  143.   
  144.   //function fAppendSubLink(sId, sCat)
  145.   menu.Addition.AppendSubLink.Bool = true;
  146.   menu.Addition.AppendSubLink.Add("0", "无分类");
  147.   
  148.   //function fAddLink(sLink, bInherit)
  149.   menu.Link.Add("/class.asp?classid=", false);
  150.   menu.Link.Add("&nclassid=", true);
  151.   
  152.   //function fAddLinkhighlight(sQuery, sBgColor, sFgColor)
  153.   menu.Query.Highlight.Add("classid", "black", "white");
  154.   menu.Query.Highlight.Add("nclassid", "brown", "white");
  155.   
  156.   menu.Go();
  157.   menu = null;
  158. //]]>
  159. </script>



  160. 1.3 调用 3 (Jscript)
  161. <% 
  162.  var MyMenuStr = fGetString("select * from v_cat_query_3tbl", conn);
  163.  
  164.  //Response.Write(MyMenuStr);
  165.  
  166.  function fGetString(sQuery, sConn, iRow, sColumnDelimeter, sRowDelimeter, sNullStr)
  167.  {// shawl.qiu code
  168.   var MyRs = null;
  169.   var bClose = true;
  170.   var sReturn = "";
  171.   
  172.   if(!iRow) iRow = -1;
  173.   if(!sColumnDelimeter) sColumnDelimeter = "##";
  174.   if(!sRowDelimeter) sRowDelimeter = "##@";
  175.   if(!sNullStr) sNullStr = "";
  176.   
  177.   if(typeof(sQuery)=="object") 
  178.   {
  179.    MyRs = sQuery;
  180.    bClose = false;
  181.   }
  182.   else
  183.   {
  184.    MyRs = new ActiveXObject("adodb.recordset");
  185.    MyRs.Open(sQuery, sConn, 1);
  186.   }
  187.   
  188.    sReturn = MyRs.GetString(2, iRow, sColumnDelimeter, sRowDelimeter, sNullStr);
  189.   
  190.   if(bClose)
  191.   {
  192.    MyRs.Close();
  193.    MyRs = null;
  194.   }
  195.   
  196.   return sReturn;
  197.  } // end function fGetString
  198. %>
  199.  <div id="MenuBar">&nbsp;</div>
  200. <script type='text/javascript' src='/sqFwJsCs/default.js'></script>
  201. <script type="text/javascript">
  202. //<![CDATA[
  203.  im.go('UI.Menu');
  204.  //im.help('UI.Menu');
  205.  /*--------------------------end sqFwJsCs----------------------------------*/
  206. //]]>
  207. </script>
  208. <script type="text/javascript">
  209. //<![CDATA[

  210.  var MenuStr3 = 
  211.  "<% Response.Write(MyMenuStr); %>"
  212.  ;
  213.  
  214.  var menu = new Menu();
  215.   menu.Debug.Bool = false;
  216.   
  217. //    menu.String = MenuStr2;
  218.   menu.String = MenuStr3;
  219.   menu.Main.ID = "MenuBar";
  220.   
  221.   menu.Direction.Horizontal.Bool = true;
  222.   menu.Direction.Horizontal.Main.Width = "99.5%";
  223. //    menu.Direction.Vertical.Bool = true;
  224.   

  225.   menu.Symbol.Item = "##";
  226.   menu.Symbol.Column = "##@";
  227.   
  228.   //function fAppendSubLink(sId, sCat)
  229.   menu.Addition.AppendSubLink.Bool = true;
  230.   menu.Addition.AppendSubLink.Add("0", "无分类");
  231.   
  232.   //function fAddLink(sLink, bInherit)
  233.   menu.Link.Add("category.asp?cat1id=", false);
  234.   menu.Link.Add("&cat2id=", true);
  235.   menu.Link.Add("&cat3id=", true);
  236.   
  237.   //function fAddLinkhighlight(sQuery, sBgColor, sFgColor)
  238.   menu.Query.Highlight.Add("cat1id", "black", "white");
  239.   menu.Query.Highlight.Add("cat2id", "brown", "white");
  240.   menu.Query.Highlight.Add("cat3id", "red", "white");
  241.   
  242.   menu.Go();
  243.   menu = null;

  244. //]]>
  245. </script>


  246. 2. 演示
  247. 2.1 动态水平垂直显示菜单演示

  248. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  249. <html xmlns="http://www.w3.org/1999/xhtml">
  250. <!-- DW6 -->
  251. <head>
  252. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  253. <title>shawl.qiu template</title>
  254. <script type="text/javascript">
  255. //<![CDATA

  256.  var MenuStr2 = '23##海纳百川##12##办公软件##@23##海纳百川##13##网页制作##@23##海纳百川##14##图象处理##@23##海纳百川##88##服务器篇##@23##海纳百川##126##功能测试##@23##海纳百川##156##FromXoopsNewbb##@23##海纳百川##158##FromXoopsXphpbbi##@23##海纳百川##159##有容乃大##@23##海纳百川##160##FromXoopsGipbb##@23##海纳百川##161##FromXoopsGiss##@23##海纳百川##162##FromXoopsGiArticles##@23##海纳百川##166##FromXoopsNews##@23##海纳百川##167##FromPhpbbForum##@23##海纳百川##170##设计##@23##海纳百川##171##网站##@23##海纳百川##172##调查##@23##海纳百川##173##金融##@23##海纳百川##197##FromLeadBBS##@23##海纳百川##206##投稿/撰稿/征文##@23##海纳百川##219##操作系统/OS##@23##海纳百川##223##丛书##@50##技术记##127##开发-本站##@50##技术记##179##C##@50##技术记##180##Linux##@50##技术记##183##RegExp-正则表达式##@50##技术记##193##Javascript/Jscript##@50##技术记##194##SQL/数据库##@50##技术记##195##ASP##@50##技术记##196##HTML##@50##技术记##203##技术翻译##@50##技术记##210##技术趣味##@50##技术记##211##草稿箱##@50##技术记##212##WebServices##@50##技术记##214##CSS##@50##技术记##215##XHTML##@50##技术记##229##MS-SQL Server##@50##技术记##233##Javascript/Jscript(client-side)##@50##技术记##241##Ajax##@50##技术记##243##XML##@50##技术记##247##c#/.net##@14##读书记##177##文学手记##@14##读书记##178##文学札记##@14##读书记##220##IT-札记##@14##读书记##221##WSJ##@14##读书记##231##杂文##@14##读书记##234##优美歌词/诗词##@56##英语角##96##基础资料##@56##英语角##198##英文/歌词&诗词##@56##英语角##199##英-英阅读##@56##英语角##200##英-汉阅读##@56##英语角##202##语法&写作##@51##工具箱##64##实用链接##@51##工具箱##66##在线工具##@51##工具箱##71##配色方案##@51##工具箱##72##设计概念##@51##工具箱##175##行业常识##@51##工具箱##184##模板##@51##工具箱##204##基层工具##@51##工具箱##230##文件头/File Header##@59##人工智能##228##基础资料##@57##程序设计##185##C语言##@57##程序设计##186##C++##@57##程序设计##187##C###@57##程序设计##188##VB##@57##程序设计##189##VF##@57##程序设计##190##Delphi##@6##数据库##36##Access##@6##数据库##37##Oracle##@6##数据库##38##SQL Server##@6##数据库##39##MySQL##@6##数据库##208##ADO##@6##数据库##213##书##@6##数据库##218##Postgresql##@4##网络编程##15##Flash##@4##网络编程##20##HTML##@4##网络编程##21##XML##@4##网络编程##22##ASP##@4##网络编程##23##JSP##@4##网络编程##24##PHP##@4##网络编程##25##CGI##@4##网络编程##26##.NET##@4##网络编程##27##Script##@4##网络编程##87##CSS##@4##网络编程##154##RegExp-正则##@4##网络编程##191##Java ##@4##网络编程##192##Perl ##@4##网络编程##207##Ajax##@4##网络编程##209##XHTML##@4##网络编程##217##书##@4##网络编程##225##shtml##@4##网络编程##226##安全信息##@4##网络编程##227##RBAC/权限设计##@4##网络编程##232##JScript/Server-Side##@4##网络编程##239##DOM##@4##网络编程##240##DHTML##@4##网络编程##248##多媒体##@4##网络编程##249##SSI##@60##.Net##235##相关文摘##@60##.Net##236##C#/CSharp .net##@60##.Net##237##JScript .Net##@60##.Net##238##VB .net##@60##.Net##242##ASP.NET##@61##架构/概念##244##面向对象##@61##架构/概念##245##开发##@10##站点大事记##61##绿色进化 E-Studio_2004##@10##站点大事记##155##绿色学院 - Green Institute_2006##@';

  257.  var MenuStr3 = 
  258.  "1##JScript##1##函数库##2##文件##@1##JScript##1##函数库##3##测试##@1##JScript##4##类库##6##数据操作##@1##JScript##9##prototype库######@1##JScript##16##模板库######@1##JScript##8##杂类######@1##JScript##14##函数收藏######@5##JavaScript##39##枚举######@5##JavaScript##41##收藏######@5##JavaScript##12##函数库######@5##JavaScript##11##类库######@5##JavaScript##7##小工具######@7##VBScript##10##类库######@7##VBScript##18##函数库##7##文件函数##@15##ActionScript##34##函数库######@15##ActionScript##35##类库######@12##CSharp .Net##23##函数库##9##文件操作##@12##CSharp .Net##23##函数库##10##数据操作##@12##CSharp .Net##31##函数收藏######@12##CSharp .Net##29##控件库######@12##CSharp .Net##24##static 库######@12##CSharp .Net##22##类库######@12##CSharp .Net##32##名称空间######@12##CSharp .Net##40##开发小工具######@12##CSharp .Net##38##杂类######@12##CSharp .Net##27##模板库##8##数据绑定##@12##CSharp .Net##27##模板库##11##aspx 页模板##@12##CSharp .Net##27##模板库##12##ascx 页模板##@11##JScript .Net##20##函数库######@11##JScript .Net##21##类库######@10##Sql##15##Access######@10##Sql##33##MsSql######@10##Sql##36##数据表模板######@13##xhtml##25##普通应用######@14##xml##28##模板库######@9##CSS##13##导航######@9##CSS##17##模板库######@16##Utility##37##Server######@8##测试类##########@"
  259.  ;
  260.  
  261.  function fVertical(sId)
  262.  {
  263.   var EleDiv  = document.getElementById(sId);
  264.   if(sId==null)
  265.   {
  266.    alert("菜单主域为null!");
  267.   }
  268.   
  269.   var bMenuStr2 = confirm("确定显示二级分类, 否显示三级分类.");
  270.   var MyMenuStr = "";
  271.   if(bMenuStr2) MyMenuStr = MenuStr2; 
  272.   else MyMenuStr = MenuStr3;
  273.   
  274.   if(EleDiv.parentNode.nodeName=="SPAN")
  275.   {
  276.    var EleGrandfather = EleDiv.parentNode.parentNode;
  277.    
  278.    var NewEleDiv = document.createElement("div");
  279.     NewEleDiv.id = sId;
  280.     EleGrandfather.replaceChild(NewEleDiv, EleDiv.parentNode);
  281.     
  282.    var EleStyleId = sId+"sqMenuStyleId";
  283.    var EleStyle = document.getElementById(EleStyleId);
  284.    if(EleStyle!=nullEleStyle.parentNode.removeChild(EleStyle);
  285.    
  286. //   return;
  287.     
  288.    var menu = new Menu();
  289.     menu.Debug.Bool = false;
  290.     
  291.       menu.String = MyMenuStr;
  292.     menu.Main.ID = "MenuBar";
  293.     
  294.     //menu.Direction.Horizontal.Bool = true;
  295.     //menu.Direction.Horizontal.Main.Width = "99.5%";
  296.     
  297.     menu.Direction.Vertical.Bool = true;
  298.     menu.Direction.Style.Width = 120;
  299.     
  300.     menu.Symbol.Item = "##";
  301.     menu.Symbol.Column = "##@";
  302.     
  303.     //function fAppendSubLink(sId, sCat)
  304.     menu.Addition.AppendSubLink.Bool = true;
  305.     menu.Addition.AppendSubLink.Add("0", "无分类");
  306.     
  307.     //function fAddLink(sLink, bInherit)
  308.     menu.Link.Add("?level1=", false);
  309.     menu.Link.Add("&level2=", true);
  310.     menu.Link.Add("&level3=", true);
  311.     
  312.     //function fAddLinkhighlight(sQuery, sBgColor, sFgColor)
  313.     menu.Query.Highlight.Add("level1", "black", "white");
  314.     menu.Query.Highlight.Add("level2", "brown", "white");
  315.     menu.Query.Highlight.Add("level3", "red", "white");
  316.     
  317.     menu.Go();
  318.     menu = null;

  319.   }
  320.  } // end function fVertical;
  321.  
  322.  function fHorizontal(sId)
  323.  {
  324.   var EleDiv  = document.getElementById(sId);
  325.   if(sId==null)
  326.   {
  327.    alert("菜单主域为null!");
  328.   }
  329.   
  330.   var bMenuStr2 = confirm("确定显示二级分类, 否显示三级分类.");
  331.   var MyMenuStr = "";
  332.   if(bMenuStr2) MyMenuStr = MenuStr2; 
  333.   else MyMenuStr = MenuStr3;
  334.   
  335.   if(EleDiv.parentNode.nodeName=="SPAN")
  336.   {
  337.    var EleGrandfather = EleDiv.parentNode.parentNode;
  338.    
  339.    var NewEleDiv = document.createElement("div");
  340.     NewEleDiv.id = sId;
  341.     EleGrandfather.replaceChild(NewEleDiv, EleDiv.parentNode);
  342.     
  343.    var EleStyleId = sId+"sqMenuStyleId";
  344.    var EleStyle = document.getElementById(EleStyleId);
  345.    if(EleStyle!=nullEleStyle.parentNode.removeChild(EleStyle);
  346.    
  347. //   return;
  348.     
  349.    var menu = new Menu();
  350.     menu.Debug.Bool = false;
  351.     
  352.       menu.String = MyMenuStr;
  353.     menu.Main.ID = "MenuBar";
  354.     
  355.     menu.Direction.Horizontal.Bool = true;
  356.     menu.Direction.Horizontal.Main.Width = "99.5%";
  357.     
  358. /*
  359.     menu.Direction.Vertical.Bool = true;
  360.     menu.Direction.Style.Width = 120;
  361. */
  362.     
  363.     menu.Symbol.Item = "##";
  364.     menu.Symbol.Column = "##@";
  365.     
  366.     //function fAppendSubLink(sId, sCat)
  367.     menu.Addition.AppendSubLink.Bool = true;
  368.     menu.Addition.AppendSubLink.Add("0", "无分类");
  369.     
  370.     //function fAddLink(sLink, bInherit)
  371.     menu.Link.Add("?level1=", false);
  372.     menu.Link.Add("&level2=", true);
  373.     menu.Link.Add("&level3=", true);
  374.     
  375.     //function fAddLinkhighlight(sQuery, sBgColor, sFgColor)
  376.     menu.Query.Highlight.Add("level1", "black", "white");
  377.     menu.Query.Highlight.Add("level2", "brown", "white");
  378.     menu.Query.Highlight.Add("level3", "red", "white");
  379.     
  380.     menu.Go();
  381.     menu = null;

  382.   }

  383.  } // end function fVertical;
  384. //]]>
  385. </script>
  386. </head>
  387. <body>
  388. <div id="MenuBar">&nbsp;</div>

  389. <div style="text-align:right; ">
  390.  <button onclick="fHorizontal('MenuBar');">Horizontal Demo</button>
  391.  <button onclick="fVertical('MenuBar');">Vertical Demo</button>
  392. </div>
  393. <script type='text/javascript' src='/sqFwJsCs/default.js'></script>
  394. <script type="text/javascript">
  395. //<![CDATA[
  396.  im.go('UI.Menu');
  397.  //im.help('UI.Menu');
  398.  /*--------------------------end sqFwJsCs----------------------------------*/
  399. //]]>
  400. </script>
  401. <script type="text/javascript">
  402. //<![CDATA[
  403.  
  404.  var menu = new Menu();
  405.   menu.Debug.Bool = false;
  406.   
  407. //    menu.String = MenuStr2;
  408.   menu.String = MenuStr3;
  409.   menu.Main.ID = "MenuBar";
  410.   
  411.   menu.Direction.Horizontal.Bool = true;
  412.   menu.Direction.Horizontal.Main.Width = "99.5%";
  413. //    menu.Direction.Vertical.Bool = true;
  414.   
  415.   menu.Symbol.Item = "##";
  416.   menu.Symbol.Column = "##@";
  417.   
  418.   //function fAppendSubLink(sId, sCat)
  419.   menu.Addition.AppendSubLink.Bool = true;
  420.   menu.Addition.AppendSubLink.Add("0", "无分类");
  421.   
  422.   //function fAddLink(sLink, bInherit)
  423.   menu.Link.Add("?level1=", false);
  424.   menu.Link.Add("&level2=", true);
  425.   menu.Link.Add("&level3=", true);
  426.   
  427.   //function fAddLinkhighlight(sQuery, sBgColor, sFgColor)
  428.   menu.Query.Highlight.Add("level1", "black", "white");
  429.   menu.Query.Highlight.Add("level2", "brown", "white");
  430.   menu.Query.Highlight.Add("level3", "red", "white");
  431.   
  432.   menu.Go();
  433.   menu = null;

  434. //]]>
  435. </script>
  436. </body>
  437. </html>


2. Menu class 核心源码
  1. // shawl.qiu JavaScript Document
  2.  /*-----------------------------------------------------------------------------------*/
  3.   * shawl.qiu Javascript Menu class v1.0
  4.  /*-----------------------------------------------------------------------------------*/
  5.  //---------------------------------begin class Menu()-------------------------------//
  6.  function Menu()
  7.  { // shawl.qiu code
  8.   //------------------------------------begin public variable
  9.   //---------------begin about
  10.   this.au = {}
  11.   this.au.Subject = "shawl.qiu Javascript Menu class";
  12.   this.au.Version = "v1.0";
  13.   this.au.Name = "shawl.qiu";
  14.   this.au.Email = "shawl.qiu@gmail.com";
  15.   this.au.Blog = "http://blog.csdn.net/btbtd";
  16.   this.au.CreatedDate = "2007-5-18";
  17.   this.au.Update = {};
  18.   this.au.Update["1"] = "";
  19.   //---------------end about
  20.   
  21.   this.String = "";
  22.   this.Main = {}
  23.   this.Main.ID = "";
  24.   
  25.   this.Symbol = {};
  26.   this.Symbol.Item = "##";
  27.   this.Symbol.Column = "##@";
  28.   
  29.   this.Set = [];
  30.   
  31.   this.Prefix = "sfdqewrterg8987sfdasdf";
  32.   this.Postfix = "JHjhifsadfyuyhjhasjkdf77";
  33.   
  34.   this.Addition = {};
  35.   this.Addition.AppendSubLink = {}
  36.   this.Addition.AppendSubLink.Bool = false;
  37.   this.Addition.AppendSubLink.Set = []; // array [iId, sCat]
  38.   this.Addition.AppendSubLink.Add = fAppendSubLink; 
  39.   
  40.   this.Link = {};
  41.   this.Link.Set = [];
  42.   this.Link.Add = fAddLink;
  43.   
  44.   this.Query = {}
  45.   this.Query.Highlight = {};
  46.   this.Query.Highlight.Set = [];
  47.   this.Query.Highlight.Add = fAddLinkhighlight;
  48.   
  49.   this.Level = {};
  50.   this.Level.Count = 0;
  51.   this.Level.ClassNamePrefix = "sqMenuLevalClassPrefix";
  52.   
  53.   this.Class = {}
  54.   this.Class.Display = "sqMenuDisplaySubItem";
  55.   this.Class.Hidden = "sqMenuHiddenSubItem";
  56.   this.Class.MenuMain = "Layout";
  57.     
  58.   this.Style = {};
  59.   this.Style.ID = "sqMenuStyleId";
  60.   
  61.   this.Count = 1;
  62.   
  63.   this.Debug = {}
  64.   this.Debug.Bool = false;
  65.   this.Debug.Element = null;
  66.   
  67.   this.ClearFloat = true;
  68.   
  69.   this.Direction = {}
  70.   this.Direction.Style = {}
  71.   this.Direction.Style.Width = 100;
  72.   this.Direction.Style.PlusLeft = 4;
  73.   this.Direction.Style.BgColor = "whitesmoke";
  74.   this.Direction.Style.Padding = "2px 0px 2px 0px";
  75.   
  76.   // begin Direction Vertical css style definition
  77.   this.Direction.Vertical = {}
  78.   this.Direction.Vertical.Bool = false;
  79.   
  80.   this.Direction.Vertical.A = {}
  81.   
  82.   this.Direction.Vertical.A.Top ={}
  83.   
  84.   this.Direction.Vertical.A.Top.Link = {};
  85.   this.Direction.Vertical.A.Top.Link.Color = "black";
  86.   this.Direction.Vertical.A.Top.Link.Padding = "2px 0px 2px 2px";
  87.   this.Direction.Vertical.A.Top.Link.Addition = "";
  88.   
  89.   this.Direction.Vertical.A.Top.Hover = {}
  90.   this.Direction.Vertical.A.Top.Hover.Color = "#fff";
  91.   this.Direction.Vertical.A.Top.Hover.BgColor = "#002BB8";
  92.   this.Direction.Vertical.A.Top.Hover.Addition = "";
  93.   
  94.   this.Direction.Vertical.A.Top.Visited = {}
  95.   this.Direction.Vertical.A.Top.Visited.Paddding = "2px 0px 2px 2px";
  96.   this.Direction.Vertical.A.Top.Visited.Addition = "";
  97.   
  98.   this.Direction.Vertical.A.SubItem = {}
  99.   
  100.   this.Direction.Vertical.A.SubItem.Link = {}
  101.   this.Direction.Vertical.A.SubItem.Link.Color = "gray";
  102.   this.Direction.Vertical.A.SubItem.Link.WhiteSpace = "nowrap";
  103.   this.Direction.Vertical.A.SubItem.Link.Overflow = "hidden";
  104.   this.Direction.Vertical.A.SubItem.Link.Addition = "";
  105.   
  106.   this.Direction.Vertical.A.SubItem.Hover = {}
  107.   this.Direction.Vertical.A.SubItem.Hover.Color = "white";
  108.   this.Direction.Vertical.A.SubItem.Hover.BgColor = "blue";
  109.   this.Direction.Vertical.A.SubItem.Hover.Addition = "";
  110.   
  111.   this.Direction.Vertical.A.SubItem.Visited = {}
  112.   this.Direction.Vertical.A.SubItem.Visited.Color = "gainsboro";
  113.   this.Direction.Vertical.A.SubItem.Visited.BgColor = "whitesmoke";
  114.   this.Direction.Vertical.A.SubItem.Visited.Padding = "2px";
  115.   this.Direction.Vertical.A.SubItem.Visited.WhiteSpace = "nowrap";
  116.   this.Direction.Vertical.A.SubItem.Visited.Overflow = "hidden";
  117.   this.Direction.Vertical.A.SubItem.Visited.Addition = "";
  118.   
  119.   this.Direction.Vertical.Item = {}
  120.   this.Direction.Vertical.Item.Overflow = "visible";
  121.   this.Direction.Vertical.Item.Border = "0px";
  122.   this.Direction.Vertical.Item.BottomStyle = "1px solid black";
  123.   this.Direction.Vertical.Item.Addition = "";
  124.   // end Direction Vertical css style definition
  125.   
  126.   // begin Direction Horizontal css style definition
  127.   this.Direction.Horizontal = {}
  128.   this.Direction.Horizontal.Bool = false;
  129.   
  130.   this.Direction.Horizontal.Main = {}
  131.   this.Direction.Horizontal.Main.Float = "left";
  132.   this.Direction.Horizontal.Main.Width = "99.5%";
  133.   
  134.   this.Direction.Horizontal.A = {}
  135.   
  136.   this.Direction.Horizontal.A.Top ={}
  137.   
  138.   this.Direction.Horizontal.A.Top.Link = {};
  139.   this.Direction.Horizontal.A.Top.Link.Color = "black";
  140.   this.Direction.Horizontal.A.Top.Link.Padding = "2px 5px";
  141.   this.Direction.Horizontal.A.Top.Link.Addition = "";
  142.   
  143.   this.Direction.Horizontal.A.Top.Hover = {}
  144.   this.Direction.Horizontal.A.Top.Hover.Color = "#fff";
  145.   this.Direction.Horizontal.A.Top.Hover.BgColor = "#002BB8";
  146.   this.Direction.Horizontal.A.Top.Hover.Addition = "";
  147.   
  148.   this.Direction.Horizontal.A.Top.Visited = {}
  149.   this.Direction.Horizontal.A.Top.Visited.Paddding = "2px 5px";
  150.   this.Direction.Horizontal.A.Top.Visited.Addition = "";
  151.   
  152.   this.Direction.Horizontal.A.SubItem = {}
  153.   
  154.   this.Direction.Horizontal.A.SubItem.Link = {}
  155.   this.Direction.Horizontal.A.SubItem.Link.Color = "gray";
  156.   this.Direction.Horizontal.A.SubItem.Link.WhiteSpace = "nowrap";
  157.   this.Direction.Horizontal.A.SubItem.Link.BorderLeft = "4px solid whitesmoke";
  158.   this.Direction.Horizontal.A.SubItem.Link.Overflow = "hidden";
  159.   this.Direction.Horizontal.A.SubItem.Link.Addition = "";
  160.   
  161.   this.Direction.Horizontal.A.SubItem.Hover = {}
  162.   this.Direction.Horizontal.A.SubItem.Hover.Color = "white";
  163.   this.Direction.Horizontal.A.SubItem.Hover.BgColor = "blue";
  164.   this.Direction.Horizontal.A.SubItem.Hover.Addition = "";
  165.   
  166.   this.Direction.Horizontal.A.SubItem.Visited = {}
  167.   this.Direction.Horizontal.A.SubItem.Visited.Color = "gainsboro";
  168.   this.Direction.Horizontal.A.SubItem.Visited.BgColor = "whitesmoke";
  169.   this.Direction.Horizontal.A.SubItem.Visited.Padding = "2px";
  170.   this.Direction.Horizontal.A.SubItem.Visited.WhiteSpace = "nowrap";
  171.   this.Direction.Horizontal.A.SubItem.Visited.BorderLeft = "4px solid whitesmoke";
  172.   this.Direction.Horizontal.A.SubItem.Visited.Overflow = "hidden";
  173.   this.Direction.Horizontal.A.SubItem.Visited.Addition = "";
  174.   
  175.   this.Direction.Horizontal.Item = {}
  176.   this.Direction.Horizontal.Item.Overflow = "visible";
  177.   this.Direction.Horizontal.Item.Border = "0px";
  178.   this.Direction.Horizontal.Item.BottomStyle = "1px solid black";
  179.   this.Direction.Horizontal.Item.BgColor = "whitesmoke";
  180.   this.Direction.Horizontal.Item.Addition = "";
  181.   
  182.   this.Direction.Horizontal.Item.A  = {}
  183.   this.Direction.Horizontal.Item.A.Color = "";
  184.   this.Direction.Horizontal.Item.A.BgColor = "whitesmoke";
  185.   this.Direction.Horizontal.Item.A.Margin = "0px 0px 1px 0px";
  186.   this.Direction.Horizontal.Item.A.Padding = "1px 0px";
  187.   this.Direction.Horizontal.Item.A.BorderBottom = "1px solid black";
  188.   this.Direction.Horizontal.Item.A.Addition = "";
  189.   // end Direction Horizontal css style definition
  190.   
  191.   //------------------------------------end public variable
  192.   
  193.   //------------------------------------begin private variable
  194.   var Tl = this;
  195.   var pMain = null;
  196.   var pStyleId = "";
  197.   var pLocationSearch = "";
  198.   //------------------------------------end private variable
  199.   
  200.   //------------------------------------begin public method
  201.   this.Go = fGo;
  202.   //------------------------------------end public method
  203.  
  204.   //------------------------------------begin private method
  205.   
  206.   function fGo()
  207.   {
  208.    if(Tl.String=="")
  209.    {
  210.     alert("菜单字串为空!");
  211.     return;
  212.    }
  213.    
  214.    Tl.String = fEncode(Tl.String);
  215.    
  216.    pMain = document.getElementById(Tl.Main.ID);
  217.    if(pMain==null)
  218.    {
  219.     alert("菜单主域为空!");
  220.     return;
  221.    }
  222.    
  223.    pLocationSearch = location.search;
  224.    
  225.    // appending css style
  226.    fAppendDirectionCss();
  227.    pStyleId = Tl.Main.ID+Tl.Style.ID;
  228.    
  229.    pMain.innerHTML = "";
  230.    var EleMenuMain = document.createElement("span");
  231.    EleMenuMain.className = pMain.id+Tl.Class.MenuMain;
  232.    
  233.    fPutNodeInOther(pMain, EleMenuMain);
  234.    
  235.    pMain.style.zIndex = 9999;
  236.    //pMain.style.width = Tl.Direction.Horizontal.Main.Width;
  237.    
  238.    var aColumn = Tl.String.split(Tl.Symbol.Column);
  239.    var TotalItem = aColumn.length;
  240.    
  241.    var aTopLevel = [];
  242.    var reGetTopLevel = new RegExp("^(.*?)"+Tl.Symbol.Item+"(.*?)"+Tl.Symbol.Item, "i");

  243.    var iAColumnLen=aColumn.length;
  244.    var iAColumnCount = 0;
  245.    var iAddEle = 0;
  246.    while(iAColumnCount++<iAColumnLen)
  247.    {
  248.     aColumn[iAColumnCount-1].replace
  249.     (
  250.      reGetTopLevel
  251.      ,
  252.      function($1, $2, $3)
  253.      {
  254.       aTopLevel[iAddEle++] = $2+Tl.Symbol.Item+$3;
  255.      }
  256.     );
  257.    } // end while(aColumn[iAColumn++])
  258.    
  259.    aTopLevel = fClearArrayRepeats(aTopLevel);
  260.  
  261.    var iATopLevel = 0;
  262.    var iATopLevelLength = aTopLevel.length;
  263.    var iATopLevelCount = 0;
  264.    
  265.    while(iATopLevel++<iATopLevelLength)
  266.    {
  267.     var Items = aTopLevel[iATopLevelCount].split(Tl.Symbol.Item);
  268.     if(Items.length!=2)continue;
  269.     
  270.     var EleSpanTop = document.createElement("span");
  271.      EleSpanTop["title"] = Items[1];
  272.      EleSpanTop.className = Tl.Main.ID+Tl.Level.ClassNamePrefix+1;
  273.     
  274.     var EleA = document.createElement("a");
  275.      EleA.innerHTML = fDecode(Items[1]);
  276.      
  277.     if(Tl.Link.Set.length>0)
  278.     {
  279.      if(Tl.Link.Set[0]["Link"]!=null)
  280.      {
  281.       EleA.href = Tl.Link.Set[0]["Link"]+Items[0];
  282.       
  283.       fHighlightCurrentCat(EleA, Tl.Link.Set[0]["Link"], Items[0]);
  284.      }
  285.     }
  286.     
  287.     EleSpanTop.appendChild(EleA);
  288.     
  289.     // recursive sub menu
  290.     fGetSubMenu(aTopLevel[iATopLevelCount], EleSpanTop, Items[0], 1, [Items[0]]);
  291.     
  292.     if(!Tl.Direction.Vertical.Bool)
  293.     {
  294.      EleSpanTop.onmouseover = 
  295.       function()
  296.       {
  297.        if(this.childNodes.length<2) return;
  298.       
  299.        var Span = this.childNodes[1];
  300.        
  301.        if(fCkBrs()==1)
  302.        {
  303.         var MyParent = Span.parentNode;
  304.         
  305.         var MyTop = fFindPos(MyParent, true)+MyParent.offsetHeight;
  306.         var MyLeft = fFindPos(MyParent);
  307.         
  308.         Span.style.top = MyTop;
  309.         Span.style.left = MyLeft;
  310.        }
  311.        
  312.        Span.className = Tl.Class.Display;
  313.       } // end EleSpanTop.onmouseover
  314.     }
  315.     else
  316.     {
  317.      EleSpanTop.onmouseover = 
  318.       function()
  319.       {
  320.        if(this.childNodes.length<2) return;
  321.       
  322.        var Span = this.childNodes[1];
  323.        
  324.        if(true)//fCkBrs()==1
  325.        {
  326.         var MyParent = Span.parentNode;
  327.         
  328.         var MyTop = fFindPos(MyParent, true)+MyParent.offsetHeight;
  329.         var MyLeft = fFindPos(MyParent);
  330.         
  331.         Span.style.top = fFindPos(MyParent,true)+"px";
  332.         Span.style.left = fFindPos(MyParent)+MyParent.offsetWidth+"px";
  333.        }
  334.        
  335.        Span.className = Tl.Class.Display;
  336.       } // end EleSpanTop.onmouseover
  337.     } // end if(Tl.Direction.Vertical.Bool)
  338.       
  339.     EleSpanTop.onmouseout =
  340.      function()
  341.      {
  342.      if(this.childNodes.length<2) return;
  343.      
  344.      var Span = this.childNodes[1];
  345.       Span.className = Tl.Class.Hidden;
  346.      } // end EleSpanTop.onmouseout
  347.      
  348.     pMain.appendChild(EleSpanTop);
  349.     
  350.     iATopLevelCount++;
  351.     
  352.     // break;
  353.    } // end while((iATopLevel++)<iATopLevelLength)
  354.     
  355.    if(Tl.ClearFloat&&Tl.Direction.Horizontal.Bool)
  356.    {
  357.     var EleBr = document.createElement("br");
  358.     EleBr.style.clear = "both";
  359.     pMain.appendChild(EleBr);
  360.    }
  361.    
  362.    tryonunload = null;}catch(e){}
  363.    onunload = function()
  364.     {
  365.      fFixMemoryLeak();
  366.     };
  367.     
  368.   } // end function fGo

  369.   function fGetSubMenu(sPrefix, Ele, sParam, iIndex, aInheritParam)
  370.   {
  371.    var iNextIndex = iIndex+1;
  372.    var aInheritParamNext = fCopyStringArray(aInheritParam);
  373.    var ReGetItem = 
  374.     new RegExp
  375.     (
  376.      sPrefix+Tl.Symbol.Item
  377.      +"(.*?)"+Tl.Symbol.Item
  378.      +"(.*?)("+Tl.Symbol.Item+"|"+Tl.Symbol.Column+")"
  379.      , 
  380.      "gi"
  381.     );
  382.     
  383.     var ItemSet = [];
  384.     var ItemSetCount = 0;
  385.     
  386.     Tl.String.replace
  387.     (
  388.      ReGetItem, 
  389.      function($1,$2,$3)
  390.      {
  391.       if(($2+$3).indexOf(Tl.Symbol.Column)>-1)return;
  392.       ItemSet[ItemSetCount++] = $2+Tl.Symbol.Item+$3;
  393.      }
  394.     );
  395.     
  396.      var ItemSetLen = ItemSet.length;
  397.      if(ItemSetLen<1) return;

  398.      ItemSet = fClearArrayRepeats(ItemSet);
  399.      
  400.      var EleSpan = document.createElement("span");
  401.       EleSpan.className = Tl.Class.Hidden;
  402.      
  403.      var iItemSetLen = ItemSet.length;
  404.      var iItemSetCount = 0;
  405.      
  406.      var iAppendItemCount = 0;
  407.      
  408.      while(iItemSetCount++<iItemSetLen)
  409.      {
  410.       var iItemSetCurIndex = iItemSetCount - 1;

  411.       var MyPrefix = sPrefix+Tl.Symbol.Item+ItemSet[iItemSetCurIndex];
  412.       if(MyPrefix.indexOf(Tl.Symbol.Column)>-1)return;
  413.       
  414.       var Items = ItemSet[iItemSetCurIndex].split(Tl.Symbol.Item);
  415.       
  416.       if(Items.length!=2)continue;
  417.       if(Items[0]==""||Items[1]=="")continue;
  418.       
  419.       iAppendItemCount++;

  420.       aInheritParamNext[iIndex] = Items[0];
  421.      
  422.       var EleA = document.createElement("a");
  423.       EleA.innerHTML = fDecode(Items[1]);
  424.             
  425.       if(Tl.Link.Set.length>=iNextIndex)
  426.       {
  427.        if(Tl.Link.Set[iIndex]["Link"]!=null)
  428.        {
  429.         var sLinkPrefix = "";
  430.         
  431.         if(Tl.Link.Set[iIndex]["Inherit"])
  432.         {
  433.          var iaInheritParamNextLen = aInheritParamNext.length;
  434.          var iaInheritParamNextCount = 0;
  435.          while(iaInheritParamNextCount++<iaInheritParamNextLen)
  436.          {
  437.           if(Tl.Link.Set[iaInheritParamNextCount-1]["Link"]!=null)
  438.           {
  439.            sLinkPrefix += 
  440.             Tl.Link.Set[iaInheritParamNextCount-1]["Link"]
  441.             +aInheritParamNext[iaInheritParamNextCount-1];
  442.           }
  443.          } // end while(iaInheritParamNextCount++<iaInheritParamNextLen)
  444.         } 
  445.         else
  446.         {
  447.          sLinkPrefix = 
  448.           Tl.Link.Set[iIndex]["Link"]
  449.           +aInheritParamNext[aInheritParamNext.length-1];
  450.         } // end if

  451.         fHighlightCurrentCat(EleA, Tl.Link.Set[iIndex]["Link"], Items[0]);
  452.         EleA.href = sLinkPrefix;
  453.        } // end if 1
  454.       } // end if

  455.       var EleSpanContainer = document.createElement("span");
  456.        EleSpanContainer.className = Tl.Main.ID+"EleSpanContainer";
  457.             
  458.       EleSpanContainer.onmouseover =
  459.        function(e)
  460.        {
  461.         if(!e) e = window.event;
  462.         
  463.         var Parent = this.parentNode;
  464.         var ChildLen = this.childNodes.length;
  465.         
  466.         if(ChildLen<1)return;
  467.         
  468.         var EleA = this.childNodes[0];
  469.         
  470.         var iChildLen= 0 ;
  471.         var iChildLenCount = 0;
  472.         
  473.         while(iChildLen++<ChildLen)
  474.         {
  475.          if(this.childNodes[iChildLenCount].nodeName=="SPAN")
  476.          {
  477.          
  478.           this.childNodes[iChildLenCount].className = Tl.Class.Display;
  479.           
  480.           this.childNodes[iChildLenCount].style.left = 
  481.            Tl.Direction.Style.Width+Tl.Direction.Style.PlusLeft+"px"; 
  482.           
  483.           this.childNodes[iChildLenCount].onmouseout =
  484.            function()
  485.            {
  486.             this.className = Tl.Class.Hidden;
  487.            }
  488.          }
  489.          iChildLenCount++;
  490.         } // end while(iChildLen++<ChildLen)
  491.         
  492.        } // end EleSpanContainer.onmouseover
  493.               
  494.        EleSpanContainer.onmouseout =
  495.        function(e)
  496.        {        
  497.         var ChildLen = this.childNodes.length;
  498.         var iChildLen = 0;
  499.         
  500.         while(iChildLen++<ChildLen)
  501.         {
  502.          if(this.childNodes[iChildLen-1].nodeName=="SPAN")
  503.          {
  504.           this.childNodes[iChildLen-1].className = Tl.Class.Hidden;
  505.          }
  506.         } // end while(iChildLen++<ChildLen)
  507.        } // end EleSpanContainer.onmouseout
  508.        
  509.       arguments.callee
  510.       (
  511.        MyPrefix, 
  512.        EleSpanContainer, 
  513.        Items[0], 
  514.        iNextIndex, 
  515.        fCopyStringArray(aInheritParamNext)
  516.       );
  517.       
  518.       EleSpanContainer.appendChild(EleA);
  519.       
  520.       EleSpanContainer["title"] = Items[1];
  521.       EleSpanContainer.className = Tl.Main.ID+Tl.Level.ClassNamePrefix+iNextIndex;
  522.       
  523.       EleSpan.appendChild(EleSpanContainer)
  524.       
  525.      } // end while(iItemSetCount++<iItemSetLen)
  526.      
  527.      // append addition item
  528.      if(Tl.Addition.AppendSubLink.Bool&&Tl.Addition.AppendSubLink.Set.length>0)
  529.      {
  530.       var aInheritParamLen = aInheritParam.length;
  531.       var aInheritParamCount = 0;
  532.       
  533.       var iLinkSetLenTemp = Tl.Link.Set.length;
  534.       if(iLinkSetLenTemp>aInheritParamLen) iLinkSetLenTemp = aInheritParamLen+1;
  535.       
  536.       var sLinkPrefix = "";
  537.       while(aInheritParamCount++<iLinkSetLenTemp)
  538.       {
  539.        var aInheritParamCurIndex = aInheritParamCount-1;
  540.        
  541.        if(Tl.Link.Set[aInheritParamCurIndex]!=null)
  542.        {
  543.         sLinkPrefix +=Tl.Link.Set[aInheritParamCurIndex]["Link"]
  544.         +(aInheritParam[aInheritParamCurIndex]||"");
  545.        }
  546.       } // end while
  547.       
  548.       var iSubLinkLength = Tl.Addition.AppendSubLink.Set.length;
  549.       var iSubLinkCount = 0;

  550.       while(iSubLinkCount++<iSubLinkLength)
  551.       { 
  552.        if(Tl.Addition.AppendSubLink.Set[iSubLinkCount-1].length!=2)continue;
  553.        
  554.        var MyEleA = document.createElement("a");
  555.        var MyEleAHref = sLinkPrefix+Tl.Addition.AppendSubLink.Set[iSubLinkCount-1][0];
  556.         MyEleA.href= MyEleAHref;
  557.          
  558.         MyEleA.innerHTML = Tl.Addition.AppendSubLink.Set[iSubLinkCount-1][1];
  559.         
  560.         var EleSpanTemp = document.createElement("span");
  561.        // EleSpanTemp.className = Tl.Class.Display;
  562.         EleSpanTemp.appendChild(MyEleA);
  563.         
  564.         var sComp1 = pLocationSearch.replace(/^.*?/?/, "");
  565.         var sComp2 = MyEleAHref.replace(/^.*?/?/, "");
  566.         
  567.         if(sComp1==sComp2)
  568.         {
  569.          var aComp = sComp1.split("&");
  570.          
  571.          var EleAAddiQuery = aComp[aComp.length-1].split("=")[0];
  572.          
  573.          var iHighlightLen = Tl.Query.Highlight.Set.length;
  574.          var iHighlightCount = 0;
  575.          while(iHighlightCount++<iHighlightLen)
  576.          {
  577.           if(Tl.Query.Highlight.Set[iHighlightCount-1][0]==EleAAddiQuery)
  578.           {
  579.            MyEleA.style.backgroundColor = Tl.Query.Highlight.Set[iHighlightCount-1][1];
  580.            MyEleA.style.color = Tl.Query.Highlight.Set[iHighlightCount-1][2];
  581.            break;
  582.           }
  583.          } // end while
  584.         } // end if(sComp1==sComp2)
  585.         
  586.         EleSpan.appendChild(EleSpanTemp);
  587.         iAppendItemCount = iAppendItemCount+1;     
  588.       } // end while(iSubLinkCount++<iSubLinkLength)

  589.      } // end if
  590.      
  591.      if(iAppendItemCount>0)
  592.      {
  593.       Ele.appendChild(EleSpan);
  594.      }
  595.     
  596.   } // end function fGetSubMenu
  597.   
  598.   function fClearArrayRepeats(array, pram)
  599.   {// shawl.qiu script
  600.    var temp = '';
  601.    var mark='$$$###';
  602.     array=array.join(mark);
  603.    var re=new RegExp('.*?'+mark.replace(/(.)/g,'//$1')+'|.*?$','g');   
  604.    var re_=new RegExp(mark.replace(/(.)/g,'//$1')+'$');
  605.    
  606.    array.replace
  607.    (
  608.     re,
  609.     function()
  610.     {
  611.      if(temp.indexOf(arguments[0]) == -1) temp += arguments[0]; 
  612.     } 
  613.    ); // end array.replace
  614.    array=temp.replace(re_,'').split(mark);
  615.    
  616.    if(!pram)return array;
  617.    return fArOdr(array, pram);
  618.    function fArOdr(array, pram)
  619.    {
  620.     if(!pram)var pram=1;
  621.     switch(pram)
  622.     {
  623.      case 2: return array.reverse();
  624.      case 3: return array.sort(function(a,b){return a-b;});
  625.      case 4: return array.sort(function(a,b){return b-a;});
  626.      defaultreturn array.sort();
  627.     } // end switch
  628.    } // end function fArOdr
  629.   } // function fClearArrayRepeats
  630.   
  631.   function fFindPos(oEle, bReturnY)
  632.   { // shawl.qiu script
  633.    if(!oEle)
  634.    {
  635.     alert("对象不能为空!");
  636.     return;
  637.    }
  638.    
  639.    if(bReturnY)
  640.    {
  641.     return fFindPosY(oEle);
  642.    }
  643.    else
  644.    {
  645.     return fFindPosX(oEle);
  646.    }
  647.    
  648.    function fFindPosX(oEle)
  649.    { // shawl.qiu script
  650.     var iLeft = 0;
  651.     if(oEle.offsetParent)
  652.     {
  653.      while(true)
  654.      {
  655.       iLeft += oEle.offsetLeft;
  656.       if(!oEle.offsetParent)
  657.       {
  658.         break;
  659.       } // end if 1
  660.       oEle = oEle.offsetParent;
  661.      } // end while
  662.     }
  663.     else if(oEle.x)
  664.     {
  665.       iLeft += oEle.x;
  666.     }
  667.     return iLeft;
  668.    } // end function fFindPosX
  669.    
  670.    function fFindPosY(oEle)
  671.    { // shawl.qiu script
  672.     var iTop = 0;
  673.     if(oEle.offsetParent)
  674.     {
  675.      while(true)
  676.      {
  677.       iTop += oEle.offsetTop;
  678.       if(!oEle.offsetParent)
  679.       {
  680.         break;
  681.       } // end if 1
  682.       oEle = oEle.offsetParent;
  683.      } // end while
  684.     }
  685.     else if(oEle.y)
  686.     {
  687.       iTop += oEle.y;
  688.     }
  689.     return iTop;
  690.    } // end function fFindPosX
  691.   } // end function fFindPos
  692.   
  693.   function fAddLink(sLink, bInherit)
  694.   {
  695.    if(!bInherit) bInherit = false;
  696.    
  697.    var iIndex = Tl.Link.Set.length;
  698.    Tl.Link.Set[iIndex] = {};
  699.    Tl.Link.Set[iIndex]["Link"] = sLink;
  700.    Tl.Link.Set[iIndex]["Inherit"] = bInherit;
  701.   } // end function fAddLink
  702.   
  703.   function fInsertNode(OldNode, NewNode, bBefore)
  704.   {// shawl.qiu script
  705.    var ParentNode = OldNode.parentNode;
  706.    if(!ParentNode)return false;
  707.    if(bBefore)
  708.    {
  709.     ParentNode.insertBefore(NewNode,OldNode);
  710.        return false;
  711.    } // end if
  712.    ParentNode.replaceChild(NewNode, OldNode);
  713.    ParentNode.insertBefore(OldNode, NewNode);
  714.   } // end function fInsertNode
  715.    
  716.   function fPutNodeInOther(OldNode, NewNode)
  717.   {// shawl.qiu script
  718.    fInsertNode(OldNode, NewNode, true);
  719.    OldNode.parentNode.removeChild(OldNode);
  720.    NewNode.appendChild(OldNode);
  721.  
  722.    function fInsertNode(OldNode, NewNode, bBefore)
  723.    {// shawl.qiu script
  724.     var ParentNode = OldNode.parentNode;
  725.     if(!ParentNode)return false;
  726.     if(bBefore)
  727.     {
  728.      ParentNode.insertBefore(NewNode,OldNode);
  729.         return false;
  730.     } // end if
  731.     ParentNode.replaceChild(NewNode, OldNode);
  732.     ParentNode.insertBefore(OldNode, NewNode);
  733.    } // end function fInsertNode
  734.    
  735.   } // end function fPutNodeInOther
  736.   
  737.   function fCkBrs()
  738.   {// shawl.qiu script
  739.    switch (navigator.appName)
  740.    {
  741.     case 'Opera': return 2;
  742.     case 'Netscape': return 3;
  743.     defaultreturn 1;
  744.    }
  745.   } // end function fCkBrs 
  746.   
  747.   function fEncode(sIpt)
  748.   {
  749.    return sIpt.
  750.    replace(//+/g, "XXXXXPlus")
  751.    ;
  752.   }
  753.   
  754.   function fDecode(sIpt)
  755.   {
  756.    return sIpt.
  757.    replace(/XXXXXPlus/g, "+")
  758.    ;
  759.   } 
  760.   
  761.   function fAddLinkhighlight(sQuery, sBgColor, sFgColor)
  762.   {
  763.    if(!sQuery||!sBgColor||!sFgColor) return;
  764.    
  765.    var iIndex = Tl.Query.Highlight.Set.length;
  766.    Tl.Query.Highlight.Set[iIndex] = [];
  767.    Tl.Query.Highlight.Set[iIndex][0] = sQuery;
  768.    Tl.Query.Highlight.Set[iIndex][1] = sBgColor;
  769.    Tl.Query.Highlight.Set[iIndex][2] = sFgColor;
  770.   } // end function fAddLinkhighlight
  771.   
  772.   function fFixMemoryLeak(oEle)
  773.   {// shawl.qiu script
  774.    if(!oEle)oEle=document.body;
  775.    
  776.    var AtrSet=oEle.attributes;
  777.    if(AtrSet)
  778.    {
  779.     var AtrLen = AtrSet.length;
  780.     var iAtrLen = 0;
  781.     
  782.     while(iAtrLen++<AtrLen)
  783.     {
  784.      if(typeof oEle[AtrSet[iAtrLen-1].name]=='function')
  785.      {
  786.       oEle[AtrSet[iAtrLen-1].name]=null;
  787.      }
  788.     } // end while(iAtrLen++<AtrLen)
  789.    } // end if(AtrSet)
  790.    
  791.    if(oEle.childNodes)
  792.    {
  793.     var ChildLen = oEle.childNodes.length;
  794.     var iChildLen = 0;
  795.     
  796.     while(iChildLen++<ChildLen)
  797.     {
  798.      arguments.callee(oEle.childNodes[iChildLen-1]);
  799.     } // end while(iChildLen++<ChildLen)
  800.      
  801.    } // end if(oEle.childNodes)
  802.         
  803.   } // end function fFixMemoryLeak
  804.   
  805.   function fQueryString(sKey, bDecode, bDebug)
  806.   {
  807.    var Debug = bDebug;
  808.    if(!sKey)
  809.    {
  810.     return location.search;
  811.    }
  812.    
  813.    var sTemp = location.search.replace(/^/?/,"");
  814.    if(Debug)
  815.    {
  816.     alert(sTemp);
  817.    }
  818.    
  819.    if(sTemp=="")
  820.    {
  821.     alert("页面 Url 没有查询参数!");
  822.     return false;
  823.    }
  824.    
  825.    var ar = sTemp.split("&");
  826.    var sFinal = "";
  827.    
  828.    var iArLen = ar.length;
  829.    var iArCount = 0;
  830.    
  831.    while(iArCount++<iArLen)
  832.    {
  833.     if(Debug)
  834.     {
  835.      alert("ar[iArCount-1].toLowerCase(): "+ar[iArCount-1].toLowerCase());
  836.      alert("sKey.toLowerCase()+'=': "+sKey.toLowerCase());
  837.     }
  838.     
  839.     var arQsByPart = ar[iArCount-1].split("=");
  840.     if(arQsByPart[0].toLowerCase()==sKey.toLowerCase())
  841.     {
  842.      if(arQsByPart.length==1) continue;
  843.      
  844.      sFinal = arQsByPart[1];
  845.      if(bDecode)
  846.      {
  847.       sFinal = decodeURI(sFinal);
  848.      }
  849.      break;
  850.     }
  851.    } // end while(iArCount++iArLen)
  852.    
  853.    if(sFinal=="")
  854.    {
  855.     alert("没有键为 "+sKey+" 的查询参数!");
  856.    }
  857.    
  858.    return sFinal;
  859.   } // end function fQueryString
  860.   
  861.   function fHighlightCurrentCat(EleA, sLinkSetLinkStr, sParam)
  862.   {
  863.    var LocationSearch = location.search;
  864.    
  865.    if(LocationSearch==""&&LocationSearch.replace("?", "")=="")return;
  866.    
  867.    var iSetLen = Tl.Query.Highlight.Set.length;
  868.    var iSetCount = 0;
  869.    
  870.    while(iSetCount++<iSetLen)
  871.    {
  872.     var QSet = Tl.Query.Highlight.Set[iSetCount-1];
  873.     var sQuery = QSet[0];
  874.     
  875.     var MyHighRe = new RegExp("//b"+sQuery+"//b", "i")
  876.     
  877.     if(MyHighRe.test(LocationSearch)&&MyHighRe.test(sLinkSetLinkStr))
  878.     {
  879.      var sQueryValue = fQueryString(sQuery, true);
  880.      
  881.      if(sParam==sQueryValue)
  882.      {
  883.       EleA.style.backgroundColor = QSet[1];
  884.       EleA.style.color = QSet[2];
  885.       break;
  886.      } // end if 1
  887.     } // end if 
  888.    } // end while(iSetCount++<iSetLen)
  889.    
  890.   } // end function fHighlightCurrentCat
  891.   
  892.   function fAddStyleFromStr(sIpt, sId)
  893.   {// shawl.qiu script 
  894.    var EleStyle = document.createElement("style");
  895.    EleStyle.type = "text/css";
  896.    if(sId&&sId!="")
  897.    {
  898.     EleStyle.id = sId;
  899.    }
  900.    if(fCkBrs()==1)
  901.    {
  902.     EleStyle.styleSheet.cssText = sIpt;
  903.    }
  904.    else
  905.    {
  906.     EleStyle.innerHTML = sIpt;
  907.    }
  908.    function fCkBrs()
  909.    {
  910.     switch (navigator.appName)
  911.     {
  912.      case 'Opera': return 2;
  913.      case 'Netscape': return 3;
  914.      defaultreturn 1;
  915.     }
  916.    } // end function fCkBrs 
  917.    var EleHead=document.getElementsByTagName("head")[0]
  918.    if(!EleHead) EleHead=document.body;
  919.    EleHead.insertBefore(EleStyle, EleHead.firstChild)
  920.   } // end function fAddStyleFromStr
  921.   
  922.   function fAppendSubLink(sId, sCat)
  923.   {
  924.    if(typeof(sId)!="string"||!sCat)return;
  925.    if(sId===""||sCat==="")return;
  926.    
  927.    var iIndex = Tl.Addition.AppendSubLink.Set.length;
  928.    
  929.    Tl.Addition.AppendSubLink.Set[iIndex] = [];
  930.    
  931.    Tl.Addition.AppendSubLink.Set[iIndex][0] = sId;
  932.    Tl.Addition.AppendSubLink.Set[iIndex][1] = sCat;
  933.    
  934.   } // end function fAppendSubLink
  935.   
  936.   function fAppendDirectionCss()
  937.   {
  938.    var sMenuStyle = "";
  939.    var sId = Tl.Main.ID+Tl.Style.ID;
  940.    
  941.    if(!Tl.Direction.Vertical.Bool)
  942.    {
  943.     sMenuStyle =
  944.     "."+Tl.Main.ID+Tl.Class.MenuMain
  945.    +"{"
  946.    +" display:block;"
  947.    +" padding:"+Tl.Direction.Style.Padding+";"
  948.    +" background-color:"+Tl.Direction.Style.BgColor+";"
  949.    + "width:"+Tl.Direction.Horizontal.Main.Width+";"
  950.    //+" width:"+Tl.Direction.Horizontal.Main.Width+";";
  951.    +"}"
  952.    +""
  953.    +"#"+Tl.Main.ID+" span"
  954.    +"{"
  955.    +" float:"+Tl.Direction.Horizontal.Main.Float+";"
  956.    +"}"
  957.    +""
  958.    +"#"+Tl.Main.ID+" span a:link"
  959.    +"{"
  960.    +" padding:"+Tl.Direction.Horizontal.A.Top.Link.Padding+";"
  961.    +Tl.Direction.Horizontal.A.Top.Link.Addition
  962.    +"}"
  963.    +""
  964.    +"#"+Tl.Main.ID+" span a:hover"
  965.    +"{"
  966.    +" background-color:"+Tl.Direction.Horizontal.A.Top.Hover.BgColor+";"
  967.    +" color:"+Tl.Direction.Horizontal.A.Top.Hover.Color+"!important;"
  968.    +Tl.Direction.Horizontal.A.Top.Hover.Addition
  969.    +"}"
  970.    +""
  971.    +"#"+Tl.Main.ID+" span a:visited"
  972.    +"{"
  973.    +" padding:"+Tl.Direction.Horizontal.A.Top.Visited.Paddding+";"
  974.    +Tl.Direction.Horizontal.A.Top.Visited.Addition
  975.    +"}"
  976.    +""
  977.    +"#"+Tl.Main.ID+" span span * a:link"
  978.    +"{"
  979.    +" display:block;"
  980.    +" overflow:"+Tl.Direction.Horizontal.A.SubItem.Link.Overflow+";"
  981.    +" width:"+Tl.Direction.Style.Width+"px;"
  982.    +" white-space:"+Tl.Direction.Horizontal.A.SubItem.Link.WhiteSpace+";"
  983.    +" color:"+Tl.Direction.Horizontal.A.SubItem.Link.Color+";"
  984.    +" border-left:"+Tl.Direction.Horizontal.A.SubItem.Link.BorderLeft+";"
  985.    +Tl.Direction.Horizontal.A.SubItem.Link.Addition 
  986.    +"}"
  987.    +""
  988.    +"#"+Tl.Main.ID+" span span * a:hover"
  989.    +"{"
  990.    +" background-color: "+Tl.Direction.Horizontal.A.SubItem.Hover.BgColor+";"
  991.    +" color:"+Tl.Direction.Horizontal.A.SubItem.Hover.Color+"!important;"
  992.    +Tl.Direction.Horizontal.A.SubItem.Hover.Addition
  993.    +"}"
  994.    +""
  995.    +"#"+Tl.Main.ID+" span span * a:visited"
  996.    +"{"
  997.    +" display:block;"
  998.    +" width:"+Tl.Direction.Style.Width+"px;"
  999.    +" overflow:"+Tl.Direction.Horizontal.A.SubItem.Visited.Overflow+";"
  1000.    +" white-space:"+Tl.Direction.Horizontal.A.SubItem.Visited.WhiteSpace+";"
  1001.    +" background:"+Tl.Direction.Horizontal.A.SubItem.Visited.BgColor+";"
  1002.    +" color:"+Tl.Direction.Horizontal.A.SubItem.Visited.Color+"!important;"
  1003.     +" border-left:"+Tl.Direction.Horizontal.A.SubItem.Visited.BorderLeft+";"
  1004.    +Tl.Direction.Horizontal.A.SubItem.Visited.Addition
  1005.    +"}"
  1006.    +""
  1007.    +"#"+Tl.Main.ID+" * span.sqMenuDisplaySubItem"
  1008.    +"{"
  1009.    +" display:block;"
  1010.    +" position:absolute;"
  1011.    +" width:"+Tl.Direction.Style.Width+"px;"
  1012.    +" overflow:"+Tl.Direction.Horizontal.Item.Overflow+";"
  1013.    +" background-color: "+Tl.Direction.Horizontal.Item.BgColor+";"
  1014.    +Tl.Direction.Horizontal.Item.Addition
  1015.    +"}"
  1016.    +""
  1017.    +"#"+Tl.Main.ID+" * span.sqMenuDisplaySubItem a"
  1018.    +"{"
  1019.    +" display:block;"
  1020.    +" background-color:"+Tl.Direction.Horizontal.Item.A.BgColor+";"
  1021.    +" margin:"+Tl.Direction.Horizontal.Item.A.Margin+";"
  1022.    +" padding:"+Tl.Direction.Horizontal.Item.A.Padding+";"
  1023.    +" border-bottom:"+Tl.Direction.Horizontal.Item.A.BorderBottom+";"
  1024.    +Tl.Direction.Horizontal.Item.A.Addition
  1025.    +"}"
  1026.    +""
  1027.    +"#"+Tl.Main.ID+" * span.sqMenuHiddenSubItem"
  1028.    +"{"
  1029.    +" display:none;"
  1030.    +"}"
  1031.     ;
  1032.    }
  1033.    else
  1034.    {
  1035.     sMenuStyle =
  1036.     "."+Tl.Main.ID+Tl.Class.MenuMain
  1037.     +"{"
  1038.     +" width:"+Tl.Direction.Style.Width+"px;"
  1039.     +" display:block;"
  1040.     +"}"
  1041.     +""
  1042.     +"#"+Tl.Main.ID+" span"
  1043.     +"{"
  1044.     +" display:block;"
  1045.     +" border-bottom:"+Tl.Direction.Vertical.Item.BottomStyle+";"
  1046.     +" background-color:"+Tl.Direction.Style.BgColor+";"
  1047.     +"}"
  1048.     +""
  1049.     +"#"+Tl.Main.ID+" span a:link"
  1050.     +"{"
  1051.     +" display:block;"
  1052.     +" padding:"+Tl.Direction.Vertical.A.Top.Link.Padding+";"
  1053.     +" color:"+Tl.Direction.Vertical.A.Top.Link.Color+";"
  1054.     +" width:"+Tl.Direction.Style.Width+"px;"
  1055.     +Tl.Direction.Vertical.A.Top.Link.Addition
  1056.     +"}"
  1057.     +""
  1058.     +"#"+Tl.Main.ID+" span a:hover"
  1059.     +"{"
  1060.     +" background-color:"+Tl.Direction.Vertical.A.Top.Hover.BgColor+";"
  1061.     +" color:"+Tl.Direction.Vertical.A.Top.Hover.Color+"!important;"
  1062.     +Tl.Direction.Vertical.A.Top.Hover.Addition
  1063.     +"}"
  1064.     +""
  1065.     +"#"+Tl.Main.ID+" span a:visited"
  1066.     +"{"
  1067.     +" padding:"+Tl.Direction.Vertical.A.Top.Visited+";"
  1068.     +" display:block;"
  1069.     +" width:"+Tl.Direction.Style.Width+"px;"
  1070.     +Tl.Direction.Vertical.A.Top.Visited.Addition
  1071.     +"}"
  1072.     +""
  1073.     +"#"+Tl.Main.ID+" span span * a:link"
  1074.     +"{"
  1075.     +" display:block;"
  1076.     +" width:"+Tl.Direction.Style.Width+"px;"
  1077.     +" color:"+Tl.Direction.Vertical.A.SubItem.Link.Color+";"
  1078.     +" white-space:"+Tl.Direction.Vertical.A.SubItem.Link.WhiteSpace+";"
  1079.    +" overflow:"+Tl.Direction.Vertical.A.SubItem.Link.Overflow+";"
  1080.     +Tl.Direction.Vertical.A.SubItem.Link.Addition
  1081.     +"}"
  1082.     +""
  1083.     +"#"+Tl.Main.ID+" span span * a:hover"
  1084.     +"{"
  1085.     +" background-color:"+Tl.Direction.Vertical.A.SubItem.Hover.BgColor+"!important;"
  1086.     +" color:"+Tl.Direction.Vertical.A.SubItem.Hover.Color+"!important;"
  1087.     +Tl.Direction.Vertical.A.SubItem.Hover.Addition
  1088.     +"}"
  1089.     +""
  1090.     +"#"+Tl.Main.ID+" span span * a:visited"
  1091.     +"{"
  1092.     +" display:block;"
  1093.     +" width:"+Tl.Direction.Style.Width+"px;"
  1094.     +" white-space:"+Tl.Direction.Vertical.A.SubItem.Visited.WhiteSpace+";"
  1095.     +" overflow:"+Tl.Direction.Vertical.A.SubItem.Visited.WhiteSpace+";"
  1096.     +" background:"+Tl.Direction.Vertical.A.SubItem.Visited.Overflow+";"
  1097.     +" color:"+Tl.Direction.Vertical.A.SubItem.Visited.Color+"!important;"
  1098.     +" padding:"+Tl.Direction.Vertical.A.SubItem.Visited.Padding+";"
  1099.     +Tl.Direction.Vertical.A.SubItem.Visited.Addition
  1100.     +"}"
  1101.     +""
  1102.     +"#"+Tl.Main.ID+" * span.sqMenuDisplaySubItem"
  1103.     +"{"
  1104.     +" display:block;"
  1105.     +" position:absolute;"
  1106.     +" width:"+Tl.Direction.Style.Width+"px;"
  1107.     +" overflow:"+Tl.Direction.Vertical.Item.Overflow+";"
  1108.     +" border:"+Tl.Direction.Vertical.Item.Border+";"
  1109.     +Tl.Direction.Vertical.Item.Addition
  1110.     +"}"
  1111.     +""
  1112.     +"#"+Tl.Main.ID+" * span.sqMenuDisplaySubItem a"
  1113.     +"{"
  1114.     +" display:block;"
  1115.     +" background:"+Tl.Direction.Style.BgColor+";"
  1116.     +"}"
  1117.     +""
  1118.     +"#"+Tl.Main.ID+" * span.sqMenuHiddenSubItem"
  1119.     +"{"
  1120.     +" display:none;"
  1121.     +"}"
  1122.     ;
  1123.    }
  1124.    fAddStyleFromStr(sMenuStyle, sId);
  1125.   } // end function fAppendDirectionCss
  1126.   
  1127.   function fCopyStringArray(ar)
  1128.   {
  1129.    var sDelimiter = "x*&*sdfj;li()*009lkk7O*U(*&89";
  1130.    var sAr = ar.join(sDelimiter);
  1131.    return sAr.split(sDelimiter);
  1132.   }
  1133.   //------------------------------------end private method
  1134.  } // shawl.qiu code
  1135.  //---------------------------------end class Menu()---------------------------------//
  1136.   
  1137.  var menu = new Menu();


原创粉丝点击