Home > Web Front-end > JS Tutorial > Solution to iphone safari not supporting position fixed_javascript tips

Solution to iphone safari not supporting position fixed_javascript tips

WBOY
Release: 2016-05-16 17:53:53
Original
1105 people have browsed it

The demand is like this. The navigation of many PC web pages is fixed, such as the homepage of Google. Now if we want to transfer this fixed navigation to the mobile web, it is natural to think of position: fixed; bottom: 0, android It runs normally under iPhone Safari, but there will be a problem under iPhone Safari. When the scroll bar scrolls, the navigation bar will appear at the top of the screen, a dark piece, which is very uncoordinated. Many people recommend frameworks such as iscroll and jquery mobile, but sometimes the results are not satisfactory or you have to read the source code of the framework for secondary development, which will take a long time. After a period of research, I found a solution, which is relatively simple, but the effect is still not as good as pc web.

Copy code The code is as follows:

nav



However, the latest ios5 already supports position: fixed, which brings good news to the majority of web front-end developers.
Author: Qingliuyu
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template