安卓/移动Webkit的CSS背景附件:固定不工作? [英] Android/Mobile Webkit CSS Background-Attachment:Fixed Not Working?

查看:125
本文介绍了安卓/移动Webkit的CSS背景附件:固定不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是要疯了,或做背景附件:固定;真的没有原生的Andr​​oid浏览器的工作?

Am I just going crazy, or does background-attachment:fixed; really not work in the native Android browser?

我已经实现了一个简单的解决方法使用两个div而不是一个......的第一个div的绝对定位,并包含固定的背景图片,在其他分区的推移它的上面,并包含滚动内容。

I already implemented a simple fix by using two divs instead of one... The first div is positioned absolutely and contains the fixed background image, the other div goes on top of it and contains the scrolling content.

此修复程序(除了不必要的并发症)的问题是,由于某些原因,当我在滚动背景图像DIV的内容,背景图像完全消失了! :(

有其他人找到了一个解决办法,是不是越野车,或者你到底是我们应该用这个工作?

Has anyone else found a workaround that isn't buggy, or how exactly are we supposed to work with this?

推荐答案

通过本机浏览器滚动的,你不能这样做。这是在默认的Andr​​iod浏览器的错误。为了实现在顶部有一个固定的元素或底部,你必须申请的位置是:固定就可以了,然后实现它包含以滚动内容的其他元素上的自定义滚动。

With native browser scrolling you cannot do that. It's a bug in the default Andriod browser. To implement a fixed element at the top or the bottom you have to apply position: fixed on it and then implement a custom scrolling on the other element which contains the content to scroll.

我用这个图书馆这样的问题: http://cubiq.org/iscroll-4

I used this Library for this kind of problems: http://cubiq.org/iscroll-4

您可以找到关于它的范例。

You can find examples on its page.

这篇关于安卓/移动Webkit的CSS背景附件:固定不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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