jQuery Mobile-固定标头 [英] jQuery Mobile - fixed headers

查看:112
本文介绍了jQuery Mobile-固定标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询移动网站,我试图将标题固定在页面顶部,并在其下方滚动内容.在文档中,我找到了确切的操作方法.只需将data-position ="fixed"属性添加到标头元素即可.足够简单,并且在他们的演示页面上看起来很棒(固定的工具栏).

I have a query mobile site and I am trying to keep my header fixed at the top of the page and have the content scroll underneath. In the documentation I found exactly how to do this. Simply add data-position="fixed" attribute to the header element. Easy enough and it looks great on their demo page (Fixed Toolbars).

但是,当我站在一边做同样的事情时,我会看到难看的褪色工具栏.标头现已修复,这很好,但是我希望它始终可见(并且在用户滚动时不会淡入和淡出).

However, when I do the exact same thing on my side, I get the ugly fading toolbars. The header is now fixed, which is good, but I would like it to be always visible (and not fade in and out when the user scrolls).

所以我的问题是:是否有一种简单的方法来避免褪色? JQM如何避免在自己的演示页面上褪色?我似乎看不到他们如何以不同于我的方式实现行为.

So my question is: Is there an easy way to avoid the fading? How did JQM avoid the fading on their own demo page? I seem to not be able to see how they implement the behavior differently than I do.

非常感谢您的帮助.

推荐答案

我最终使用position: fixed;

我知道具有iOS的iPhone< 5无法应付,但我对此表示同意.

I know iPhones with iOS < 5 can't handle it, but I am OK with that.

这篇关于jQuery Mobile-固定标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆