jQuery Mobile 独立滚动列表
我正在使用 jQueryMobile 框架创建一个移动 Web 应用程序,该框架需要并排向用户显示 2 个列表。这里的问题是,我希望列表彼此独立移动,以便用户可以从左侧列表中选择一个项目,并从右侧列表中选择另一个项目,而无需同时滚动两个列表。
我研究了以下移动插件:
asyraf9.github.com/jquery-mobile/
这是一个很好的解决方案,但它更以菜单/页面为中心,我希望这两个元素都在单个页面中列出。
我在想:
<div class="ui-grid-a">
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-bar-e" style="padding-left:5%;float:left;width: 100%; overflow: scroll;">
<ul data-role="listview">
<li><a href="a.html">Example A</a></li>
<li><a href="b.html">Example B</a></li>
<li><a href="c.html">Example C</a></li>
<li><a href="d.html">Example D</a></li>
</ul>
</div>
</div>
<div class="ui-block-b" style="width:50%">
<div class="ui-bar ui-bar-b" style=" z-index: 10;position: absolute;width: 100%;padding-right: 5%; overflow: scroll;">
<ul data-role="listview">
<li><a href="a.html">Example A</a></li>
<li><a href="b.html">Example B</a></li>
<li><a href="c.html">Example C</a></li>
<li><a href="d.html">Example D</a></li>
</ul>
</div>
</div>
</div>
还有其他人提出可行的解决方案吗?
谢谢
I'm creating a Mobile Web Application using the jQueryMobile framework that requires 2 lists to be shown to the user side by side. The catch here is that I would like to have the lists move independent of one another so the user can pick and item from the left hand list, and another from the right hand list without scrolling both lists at the same time.
I've investigated the following plugin for mobile:
asyraf9.github.com/jquery-mobile/
which is a great solution, but it is more menu/page centric, and I would like to have both elements to be lists within a single page.
I was thinking something along the lines of:
<div class="ui-grid-a">
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-bar-e" style="padding-left:5%;float:left;width: 100%; overflow: scroll;">
<ul data-role="listview">
<li><a href="a.html">Example A</a></li>
<li><a href="b.html">Example B</a></li>
<li><a href="c.html">Example C</a></li>
<li><a href="d.html">Example D</a></li>
</ul>
</div>
</div>
<div class="ui-block-b" style="width:50%">
<div class="ui-bar ui-bar-b" style=" z-index: 10;position: absolute;width: 100%;padding-right: 5%; overflow: scroll;">
<ul data-role="listview">
<li><a href="a.html">Example A</a></li>
<li><a href="b.html">Example B</a></li>
<li><a href="c.html">Example C</a></li>
<li><a href="d.html">Example D</a></li>
</ul>
</div>
</div>
</div>
Has anyone else come up with a workable solution?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看iScoll 4;它可能不是 jQuery,但它是一个很棒的移动滚动 JavaScript 插件。
您可以为每个 UL 添加一个 ID,并分别为每个 UL 添加一个卷轴,如下所示:
通过您的示例,您将遵循以下原则:
我希望这会有所帮助!
Take a look at iScoll 4; it may not be jQuery, but it is a great JavaScript plugin for Mobile Scrolling.
You would add an ID to each UL and attach a scroll to each one separately like this:
With your example you would be something along these lines:
I hope this helps!
JqueryMobile 路线图 http://jquerymobile.com/roadmap/ 表示独立滚动应该在版本 1.7 中出现
作为一种破解解决方案也许通过 iframe 添加 div 可能会提供一个笨拙的解决方案。
JqueryMobile roadmap http://jquerymobile.com/roadmap/ says independent scolling should arrive in version 1.7
As a hack workaround maybe adding the divs via an iframe may offer a clumsy solution.