所以,我正在为一个允许人们在视图之间水平滑动的web应用程序构建框架。我正在寻找一个类似于ubersocial的布局,ubersocial是android的应用程序。在过去的几天里,我已经尝试了几个不同的框架(包括自定义框架的开始,它由于糟糕的溢出而无法工作:移动上的自动支持)。JqMobi似乎让我离得最近。
下面是一些代码:
<script>
//jqMobi & jqUI scripts omitted for brevity
var carousel;
var scroller;
function init_carousel ()
{
carousel = $("#carousel").carousel({
preventDefaults: false
});
scroller = $('newContainer').scroller();
}
window.addEventListener("load", init_carousel, false);
</script>
<div id="jQUi">
<div id="header"></div>
<div id="content">
<!--scrolling="no" because I don't want the whole carousel to move-->
<div title="Main" id="main" class="panel" data-tab="navbar_home" scrolling="no">
<div id="carousel" style="height:100%;width:100%;">
<div id="View1" class="MainView" style="background: yellow;">
<div id="newContainer" style="width: 100%;height: 100%; overflow: auto;>
<!--Lots of Content-->
</div>
</div>
<div id="View2" class="MainView" style="background: green;"></div>
<div id="View3" class="MainView" style="background: blue;"></div>
<div id="View4" class="MainView" style="background: pink;"></div>
<div id="View5" class="MainView" style="background: orange;"></div>
</div>
</div>
</div>
</div>因此,我已经让我的旋转木马在所有设备上工作,并且能够在iOS 5中获得完美的功能。然而,安卓(2.2、2.3和4.0)并没有为我的.MainView元素提供一个可滚动的div,旧的iOS设备也是如此。我能得到的最好的是滚动面板上的旋转木马,但是面板中的元素不会一起滚动。这让我想知道,我所获得的iOS 5的成功是否仅仅是对溢出:auto的支持。
总之,我看过以下文档:
但我真的很难找到我想要的答案。使用文档化的方法,我似乎什么也做不到。如果我能够在不破坏旋转木马的情况下将一个独立的可滚动的div放到一个.MainView元素中,那么我就可以继续了。有什么建议吗?
/*****************FIXED__*****************/
在混乱和沮丧的混乱网络之后,我最终通过在.MainDiv元素中添加第二个缓冲区来工作,这样滚动器就不会影响旋转木马。
我还使用了iOS 5(您可能还记得,它以前使用过),它可能是通过简单地添加溢出:.MainView元素的auto并给它们一个固定的高度来修复的。我首先尝试禁用nativeTouchScroll,滚动实际上非常好,所以我将坚持使用它,而不是添加浏览器检测条件。
<script>
//Native touch disabled or iOS 5 breaks.
$.feat.nativeTouchScroll = false;
var carousel;
//var scroller;
function init_carousel ()
{
carousel = $("#carousel").carousel({
preventDefaults: false
});
}
$.ui.ready(init_carousel);
var scroller;
$.ui.ready(function ()
{
//Fetch the scroller from cache
scroller = $("#containerContainer").scroller();
});
</script>
<style>
.MainView
{
height: 100%;
overflow: hidden;
}
</style>
<div id="carousel" style="height:100%;width:100%;">
<div id="View1" class="MainView" style="background: yellow;">
<div id="containerContainer"><div id="newContainer"></div></div>
</div>
<div id="View2" class="MainView" style="background: green;"></div>
<div id="View3" class="MainView" style="background: blue;"></div>
<div id="View4" class="MainView" style="background: pink;"></div>
<div id="View5" class="MainView" style="background: orange;"></div>
</div>发布于 2012-11-16 13:12:01
张贴在appMobi的论坛上--但我们是位于东部标准时区的一家美国公司--所以当你在this...glad上工作时,我们睡着了,你写了如下:)
不是说似乎有人在乎
https://stackoverflow.com/questions/13408753
复制相似问题