0

这是我的代码。底部按钮上有一个 jQuery 函数,它使列表向上滑动进入视图(这里的列表是空白的,它由 javascript 填充。这里只是空白行,如您所见。)

该列表从按钮的正上方向上滑动到视图中,并在它碰到顶部的 Home div 时停止。然后我可以滚动列表,而按钮和主 div 保持固定在屏幕的顶部和底部。反正在模拟器上。在 ipod 上,一旦列表弹出视图,当我向下滚动时,主 div 和按钮与其他所有内容一起向上移动,就好像它们是列表中的元素一样!有没有搞错?

这是一个使用PhoneGap 制作的移动应用程序。

 <body>

        <div style="position:fixed; width:100%; border-bottom: 3px solid; z-index: 19; background:#FFFFFF; padding:5px;"> 
            <a style="text-decoration:none; z-index:20;" href="index.html">Home</a>
        </div>
        <br />

        <div id="map_canvas" style="width:100%; margin-top:10px; height:400px;"></div>

        <div style="position:relative">

            <div id="resultsList" style="background: #FFFFFF; width:100%; margin-top:15px; height: 400px; z-index:1; position:absolute; bottom:0; left:0; display:none">

                <br id="top"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/>
                <hr class="filler"/>
                <br class="filler"/> 

            </div>

        </div>

        <div style="position:fixed; width:100%; border-top: 3px solid; z-index: 19; background:#FFFFFF; padding:5px;"> 
            <button id="bottombar" type="button" style="z-index:20; padding-bottom:5px;">Show as List</button>
        </div>

        <!--Maps API Key
         AIzaSyD52tRfTY1FtEgXQpvu9-jN5AOz-2pxQg0
         -->

    </body>
4

1 回答 1

0

这就是一些智能手机处理位置的方式:固定的,当你滚动时它们会移动然后回弹。

Sencha TouchjQuery Mobile可能会帮助您以一种不会出错的方式实现您的样式

于 2012-04-30T09:40:10.547 回答