does a background-attachment of fixed work in iOS5?

前端 未结 3 815
忘掉有多难
忘掉有多难 2020-12-03 21:06

Does this work in > iOS 5?

.element {
    background: url(images/myImage.jpg) 50% 0 no-repeat fixed;
}

I thought that it should, but so far

3条回答
  •  醉梦人生
    2020-12-03 21:39

    There are too many issues with the fixed position on mobile and touch devices.

    As long the background is not animated in any way(blur, css transistions any JS) AND as long there is no scrollbar, then it is usable and consistent.

    Everything else will-depending on browser- result in undesired results, image pixelation, images scaling 100 fold on IOS devices, "jumping" divs etc.

    The best work around method i have found so far, say, if you want to reproduce a fixed BG scroll page, is to use the parallax method, having one div as scrolling, the next with background transparent, rinse repeat.

    It looks good enough I think, and no plugins are needed.

提交回复
热议问题