navgation_phone.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // 13通信G5-2张岚凯 15互联网G5-3揭以诚
  2. Namespace.register("U.Control.Navgation_phone"); //注册命名空间;
  3. /*window.onload = function () {
  4. U.Control.Navgation_phone();
  5. }*/
  6. //生成导航条;logo图片自己设置
  7. U.Control.Navgation_phone = function () {
  8. var g = $$("div", { "className": "navgation" }, document.body);
  9. var a = $$("div", { "className": "navgation_head" }, g);
  10. var menu = $$("div", { "className": "menu", "onclick": "U.Control.Navgation_phone.menuopen()" }, a);
  11. var lo = $$("div", { "className": "navgation_head_logo", "innerHTML": "LOGO" }, a);
  12. var logo = $$("img", { "className": "navgation_head_logo_img" }, lo);
  13. var le = $$("div", { "className": "navgation_head_left", "id": "navgation_head_left" }, g);
  14. var c = $$("li", { "innerHTML": "首页", "onclick": "U.Control.Navgation_phone.update_content_first()" }, le);
  15. var d = $$("li", { "innerHTML": "关于我们", "onclick": "U.Control.Navgation_phone.update_content_second()" }, le);
  16. var e = $$("li", { "innerHTML": "服务中心", "onclick": "U.Control.Navgation_phone.update_content_third()" }, le);
  17. var f = $$("li", { "innerHTML": "联系我们", "onclick": "U.Control.Navgation_phone.update_content_four()" }, le);
  18. var s = $$("div", { "className": "navgation_head_search" }, a);
  19. var simg = $$("img", { "src": "search_phone.png" }, s);
  20. var con = $$("div", { "className": "navgation_content", "innerHTML": "A", "id": "navgation_content" }, g);
  21. return g;
  22. }
  23. //显示菜单
  24. U.Control.Navgation_phone.menuopen = function () {
  25. $("#navgation_head_left")[0].style.display = "block";
  26. }
  27. //更换内容同时关闭菜单栏;
  28. U.Control.Navgation_phone.update_content_first = function () {
  29. $("#navgation_head_left")[0].style.display = "none";
  30. $("#navgation_content")[0].innerHTML = 'A';
  31. }
  32. U.Control.Navgation_phone.update_content_second = function () {
  33. $("#navgation_head_left")[0].style.display = "none";
  34. $("#navgation_content")[0].innerHTML = 'B';
  35. }
  36. U.Control.Navgation_phone.update_content_third = function () {
  37. $("#navgation_head_left")[0].style.display = "none";
  38. $("#navgation_content")[0].innerHTML = 'C';
  39. }
  40. U.Control.Navgation_phone.update_content_four = function () {
  41. $("#navgation_head_left")[0].style.display = "none";
  42. $("#navgation_content")[0].innerHTML = 'D';
  43. }