// 13通信G5-2张岚凯 15互联网G5-3揭以诚 Namespace.register("U.Control.Navgation"); //注册命名空间; //生成导航条; logo图片自己设置,图片路径要是绝对路径 可以将不同板块放到 var con中 U.Control.Navgation = function () { var g = $$("div", { "className": "navgation" }, document.body); var a = $$("div", { "className": "navgation_head" }, g); var nva_log = $$("span", { "className": 'navgation_headSpan' }, a); var lo = $$("div", { "className": "navgation_head_logo", "innerHTML": "LOGO" }, a); var logo = $$("img", { "className": "navgation_head_logo_img" }, lo); var le = $$("div", { "className": "navgation_head_left" }, a); var b = $$("ul", {}, le); var c = $$("li", { "innerHTML": "首页", "onclick": "U.Control.Navgation.update_content_first()" }, b); var d = $$("li", { "innerHTML": "关于我们", "onclick": "U.Control.Navgation.update_content_second()" }, b); var e = $$("li", { "innerHTML": "服务中心", "onclick": "U.Control.Navgation.update_content_third()" }, b); var f = $$("li", { "innerHTML": "联系我们", "onclick": "U.Control.Navgation.update_content_four()" }, b); var s = $$("div", { "className": "navgation_head_search" }, a); var simg = $$("img", { "src": "http://d.1473.cn/controls/pc/navgation/search_s.png" }, s); $$("img", { "src": "nva_log.png", "onclick": "U.Control.Navgation.menuopen()" }, nva_log); var sinput = $$("input", { "className": "search", "placeholder": "搜索" }, s); var right = $$("div", { "className": "navgation_head_right" }, a); var login = $$("div", { "className": "navgation_head_login", "innerHTML": "登录" }, right); var sign = $$("div", { "className": "navgation_head_register", "innerHTML": "注册" }, right); //var con = $$("div", { "className": "navgation_content", "innerHTML": "A", "id": "navgation_content" }, g); $$("meta", { "name": "viewport", content: "width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" }, document.head); $$("meta", { "name": "apple-mobile-web-app-capable", content: "yes;" }, document.head); $$("meta", { "name": "apple-mobile-web-app-status-bar-style", content: "black;" }, document.head); $$("meta", { "name": "apple-mobile-web-app-status-bar-style", content: "telephone=no;" }, document.head); var search = $$("span", { "className": "navgation_headSearch" }, a); $$("img", { "src": "sousuo.png" }, search); return g; } //更换内容;函数内容可以自行更换 U.Control.Navgation.update_content_first = function () { $("#navgation_content")[0].innerHTML = 'A'; } U.Control.Navgation.update_content_second = function () { $("#navgation_content")[0].innerHTML = 'B'; } U.Control.Navgation.update_content_third = function () { $("#navgation_content")[0].innerHTML = 'C'; } U.Control.Navgation.update_content_four = function () { $("#navgation_content")[0].innerHTML = 'D'; } U.Control.Navgation.menuopen = function () { event.stopPropagation(); $(".navgation_head_left")[0].style.display = "block"; } U.Control.Navgation_close = function () { if (this.Tagname != "navgation_head_left") { $(".navgation_head_left")[0].style.display = "none"; } };