diff --git a/README.md b/README.md index 53bd10d..959f2d5 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,5 @@ 1. [修改平台LOGO](./dom/修改平台logo.md) 2. [修改平台标题](./dom/修改平台标题.md) 3. [增加一个footer](./dom/增加一个footer.md) -4. [隐藏侧边栏](./dom/隐藏侧边栏.md) \ No newline at end of file +4. [隐藏侧边栏](./dom/隐藏侧边栏.md) +5. [侧栏移动到右侧](./dom/侧栏移动到右侧,md) \ No newline at end of file diff --git a/dom/侧栏移动到右侧.md b/dom/侧栏移动到右侧.md new file mode 100644 index 0000000..6b20f6a --- /dev/null +++ b/dom/侧栏移动到右侧.md @@ -0,0 +1,30 @@ +# 侧栏移动到右侧 +## js +``` +// 侧栏移动到右侧 +BI.Plugin.registerObject("dec.body", function (widget) { + // 首先去掉主内容区的left值,right值设为70px + widget.element.css({ + left: 0, + right: "70px" + }); +}); +BI.Plugin.registerObject("dec.menu", function (widget) { + // 去掉menu的left值,right值设为0 + widget.element.css({ + left: "", + right: 0 + }); +}); + +BI.Plugin.registerObject("dec.menu.button", function (widget) { + // 最后将menu按钮的激活状态条移动到右边 + var line = widget.element.children(".menu-button-line"); + line.css({ + right: 0, + left: "" + }); +}); +``` +## 效果预览 +![](../screenshorts/3.png) \ No newline at end of file diff --git a/screenshorts/3.png b/screenshorts/3.png new file mode 100644 index 0000000..a234c3e Binary files /dev/null and b/screenshorts/3.png differ