Browse Source

update

master
dailer 5 years ago
parent
commit
ddaba8517a
  1. 3
      README.md
  2. 54
      dom/贴底隐藏的侧边栏.md
  3. BIN
      screenshorts/4.gif

3
README.md

@ -6,4 +6,5 @@
2. [修改平台标题](./dom/修改平台标题.md)
3. [增加一个footer](./dom/增加一个footer.md)
4. [隐藏侧边栏](./dom/隐藏侧边栏.md)
5. [侧栏移动到右侧](./dom/侧栏移动到右侧.md)
5. [侧栏移动到右侧](./dom/侧栏移动到右侧.md)
6. [贴底隐藏的侧边栏](./dom/贴底隐藏的侧边栏.md)

54
dom/贴底隐藏的侧边栏.md

@ -0,0 +1,54 @@
# 贴底隐藏的侧边栏
## js
```
// 贴底隐藏的侧边栏
BI.Plugin.registerObject("dec.body", function (widget) {
// 首先去掉主内容区的left值
widget.element.css({
left: 0
});
});
BI.Plugin.registerObject("dec.menu", function (widget) {
// 去掉menu的top值,bottom设置为0
widget.element.css({
top: "",
left: "30%",
right: "30%",
bottom: 0,
height: "10px",
width: "auto",
position: "fixed",
zIndex: 1000000
});
// 绑定hover事件
widget.element.hover(function () {
widget.element.animate({height: "70px"});
}, function () {
widget.element.animate({height: "10px"});
});
// 讲容纳menu的容器变为flex盒子
var wrapper = widget.element.children();
wrapper.css({
display: "flex",
justifyContent: "space-around"
});
// 调整一下位置
var children = widget.element.find(".dec-menu-button");
children.each(function (index, button) {
$(button).css({
marginTop: -10
});
});
});
BI.Plugin.registerObject("dec.menu.button", function (widget) {
// 移除menu状态线
var line = widget.element.children(".menu-button-line");
line.remove();
});
```
## 效果预览
![](../screenshorts/4.gif)

BIN
screenshorts/4.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Loading…
Cancel
Save