gpt4 book ai didi

Jquery-手机滑动菜单面板+滚动

转载 作者:行者123 更新时间:2023-12-01 02:43:16 25 4
gpt4 key购买 nike

我是 jQuery Mobile 新手。我需要向我的应用程序添加 Facebook 滑动面板功能。

我经历了 sliding menu panel ,它工作正常,但我在菜单面板中的内容超出了窗口大小,我想让它可滚动。

请告诉我如何修复它。

代码引用

<!DOCTYPE html>
<html>
<head>
<title>FB Style Menu</title>
<meta id="extViewportMeta" name="viewport"content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<style>
.ui-panel-inner {
overflow: hidden !important;
padding: 0px;
}
.ui-controlgroup {
margin: 0;
}
#header {
height: 54px;
}
#bars-button {
margin: 7px;
}
.panel-content {
overflow-y: scroll !important
}
</style>

<script>
$(document).on('pageshow', '#home', function(event) {
alert("init");
init(); //$.mobile.hidePageLoadingMsg();
});
function init() {
var header = $('[data-role=header]').outerHeight();
var panel = $('.ui-panel').height();
var panelheight = panel - header;
$('.ui-panel').css({
'top' : header,
'min-height' : panelheight
});
}
</script>
</head>
<body>
<div data-role="page" id="home" data-theme="b">
<div data-role="panel" id="navpanel" data-theme="a" data-display="overlay" data-position="right">
<div class="panel-content">
<div data-role="controlgroup" data-corners="false"> <a href="#" data-role="button">Business</a>
<a href="#" data-role="button">Numbers</a>
<a href="#" data-role="button">Money</a>
<a href="#" data-role="button">People</a>
<a href="#" data-role="button">Business</a>
<a href="#" data-role="button">Numbers</a>
<a href="#" data-role="button">Money</a>
<a href="#" data-role="button">People</a>
<a href="#" data-role="button">Business</a>
<a href="#" data-role="button">Numbers</a>
<a href="#" data-role="button">Money</a>
<a href="#" data-role="button">People</a>
</div>
</div>
</div>
<div id="header" data-role="header" data-theme="b">
<a id="bars-button" data-icon="bars" class="ui-btn-right" style="margin-top:10px;" href="#navpanel">Menu</a>


<!-- /About -->
</div>
</body>
</html>

最佳答案

在我看来,jQuery Mobile 的滑动面板(类似 FB)还没有准备好。我在固定导航栏和固定页脚方面遇到了一些问题。这就是为什么我开始寻找更好的替代方案来解决这个问题。

以下是我找到的一些链接:

我知道它不能解决你的问题,但它可能对你 future 的发展有所帮助:)

关于Jquery-手机滑动菜单面板+滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18739240/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com