U.EX.js 944 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * UseStudio.Example 主js文件
  3. * 负责基本页面效果
  4. * qv
  5. **/
  6. //Namespace.register("U.EX");
  7. var U = {}; U.EX = {}; //暂时没有用Uj
  8. //Util
  9. function $(id) { return document.querySelectorAll(id); } //暂时没有UJ 暂用着
  10. U.EX.SList = function (id) {//视图隐藏与否 [Mark 暂用,到时优化成状态切换]
  11. var willHide = $("#" + id)[0].style;
  12. willHide.display = (willHide.display === "block" ? "none" : "block");
  13. }
  14. U.EX.VCSwitch = function (i) {//效果视图和代码视图切换
  15. var Code = $("#U_E_C_Left")[0].style
  16. , View = $("#U_E_C_Right")[0].style;
  17. if (i === "Code") {
  18. View.display = "none"; Code.display = "block"; Code.width = 100 + "%";
  19. } else if (i === "View") {
  20. View.display = "block"; Code.display = "none"; View.width = 100 + "%";
  21. } else {
  22. View.display = "block"; View.width = 50 + "%"; Code.display = "block"; Code.width = 50 + "%";
  23. }
  24. }