我想弄清楚如何更改 JQM 面板动画的宽度。我可以更改面板中内容的宽度,但动画仍然以我不知道如何更改的预定义宽度打开。
这是我尝试过的,它改变了内容。
.ui-panel {
width: 150px;
}
我查看了 JQM 文档,但没有找到解决方案。希望得到帮助:-)
编辑
好吧,实际上,我发现这个脚本可以工作,但是......只有当我将所有@left-panel-width 更改为实际宽度为 150px 时?为什么@left-panel-width 不起作用?
@left-panel-width: 100px;
@right-panel-width: 100px;
.ui-panel {
width: @left-panel-width;
}
.ui-panel.ui-panel-position-right {
width: @right-panel-width;
}
.ui-panel.ui-panel-closed {
width: 0;
}
.ui-panel-position-left {
left: -@left-panel-width;
}
.ui-panel-animate.ui-panel-position-left.ui-panel-display-overlay, .ui-panel-animate.ui-panel-position-left.ui-panel-display-push {
-webkit-transform: translate3d(-@left-panel-width, 0, 0);
-moz-transform: translate3d(-@left-panel-width, 0, 0);
transform: translate3d(-@left-panel-width, 0, 0)
}
.ui-panel-position-right {
right: -@right-panel-width
}
.ui-panel-animate.ui-panel-position-right.ui-panel-display-overlay, .ui-panel-animate.ui-panel-position-right.ui-panel-display-push {
-webkit-transform: translate3d(@right-panel-width, 0, 0);
-moz-transform: translate3d(@right-panel-width, 0, 0);
transform: translate3d(@right-panel-width, 0, 0)
}
.ui-panel-content-fixed-toolbar-position-left.ui-panel-content-fixed-toolbar-open, .ui-panel-content-wrap-position-left.ui-panel-content-wrap-open, .ui-panel-dismiss-position-left.ui-panel-dismiss-open {
left: @left-panel-width;
right: -@right-panel-width
}
.ui-panel-animate.ui-panel-content-fixed-toolbar-position-left.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-reveal, .ui-panel-animate.ui-panel-content-fixed-toolbar-position-left.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-push, .ui-panel-animate.ui-panel-content-wrap-position-left.ui-panel-content-wrap-open.ui-panel-content-wrap-display-reveal, .ui-panel-animate.ui-panel-content-wrap-position-left.ui-panel-content-wrap-open.ui-panel-content-wrap-display-push {
-webkit-transform: translate3d(@left-panel-width, 0, 0);
-moz-transform: translate3d(@left-panel-width, 0, 0);
transform: translate3d(@left-panel-width, 0, 0)
}
.ui-panel-content-fixed-toolbar-position-right.ui-panel-content-fixed-toolbar-open, .ui-panel-content-wrap-position-right.ui-panel-content-wrap-open, .ui-panel-dismiss-position-right.ui-panel-dismiss-open {
left: -@left-panel-width;
right: @right-panel-width
}
.ui-panel-animate.ui-panel-content-fixed-toolbar-position-right.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-reveal, .ui-panel-animate.ui-panel-content-fixed-toolbar-position-right.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-push, .ui-panel-animate.ui-panel-content-wrap-position-right.ui-panel-content-wrap-open.ui-panel-content-wrap-display-reveal, .ui-panel-animate.ui-panel-content-wrap-position-right.ui-panel-content-wrap-open.ui-panel-content-wrap-display-push {
-webkit-transform: translate3d(-@right-panel-width, 0, 0);
-moz-transform: translate3d(-@right-panel-width, 0, 0);
transform: translate3d(-@right-panel-width, 0, 0)
}
@media (min-width:55em) {
.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-left, .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-left, .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-left, .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-left {
margin-right: @right-panel-width
}
.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-right, .ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-right, .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-right, .ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-right {
margin-left: @left-panel-width
}
}
提前致谢 ;-)