我正在开发一个应用程序,需要在选中某些内容时从底部滑出面板。我在jquery mobile slide panel中看到可以将位置设置为左侧或右侧,但如何设置到底部呢?
我正在开发一个应用程序,需要在选中某些内容时从底部滑出面板。我在jquery mobile slide panel中看到可以将位置设置为左侧或右侧,但如何设置到底部呢?
请查看https://github.com/jquery/jquery-mobile/pull/5770
不幸的是,arschmitz说:
由于我们对面板进行了更改,这里存在许多冲突。虽然我很喜欢这个功能,也很想尝试在1.5版本中实现它,但我将关闭此PR,因为它已经过时了,但希望与您合作,在下一个版本中实现此功能。
$(function() {
$('#openpanel').click(function(){
$('#box').animate({'bottom':'0'},300);
});
$('#close').click(function(){
$('#box').animate({'bottom':'-100%'},300)
});
});
.box{
position:fixed;
bottom:-100%;
left:0%;
height:100%;
background-color: #DBDBDB;
width: 17em;
display: block;
z-index:999999;
}
.box-inner {
position: absolute;
width:100%;
top: 0px;
bottom: 0px;
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
.ui-panel-display-overlay[data-position="bottom"] {
top: auto;
bottom: 0px;
width: 100% !important;
height: auto !important;
min-height: auto;
}
.ui-panel-animate.ui-panel-display-overlay[data-position="bottom"] {
right: 0;
-webkit-transform: translate3d(0, 100vh, 0);
-moz-transform: translate3d(0, 100vh, 0);
transform: translate3d(0, 100vh, 0);
}
.ui-panel-display-overlay[data-position="bottom"].ui-panel-display-reveal,
.ui-panel-display-overlay[data-position="bottom"].ui-panel-open {
bottom: 0;
}
.ui-panel-animate.ui-panel-open.ui-panel-display-overlay[data-position="bottom"] {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-moz-transform: none;
}
<link rel="stylesheet" href="https://demos.jquerymobile.com/1.4.5/css/themes/default/jquery.mobile-1.4.5.min.css">
<link rel="stylesheet" href="https://demos.jquerymobile.com/1.4.5/_assets/css/jqm-demos.css">
<script src="https://demos.jquerymobile.com/1.4.5/js/jquery.js"></script>
<script src="https://demos.jquerymobile.com/1.4.5/_assets/js/index.js"></script>
<script src="https://demos.jquerymobile.com/1.4.5/js/jquery.mobile-1.4.5.min.js"></script>
<body
<div data-role="page" class="jqm-demos jqm-panel-page" data-quicklinks="true">
<div role="main" class="ui-content jqm-content">
<a href="#bottompanel1" class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini">Overlay</a>
</div>
</div>
<!-- bottompanel1 -->
<div data-role="panel" id="bottompanel1" data-position="bottom" data-display="overlay" data-theme="a">
<h3>Bottom Panel: Overlay</h3>
<p>This panel is positioned at the bottom with the overlay display mode. The panel markup is <em>after</em> the header, content and footer in the source order.</p>
<p>To close, click off the panel, swipe left or right, hit the Esc key, or use the button below:</p>
<a href="#demo-links" data-rel="close" class="ui-btn ui-shadow ui-corner-all ui-btn-a ui-icon-delete ui-btn-icon-left ui-btn-inline">Close panel</a>
</div>
<!-- /bottompanel1 -->
</body>