Home >Web Front-end >HTML Tutorial >Help: Has anyone solved the problem that WeChat's built-in browser is not compatible with floating _html/css_WEB-ITnose?

Help: Has anyone solved the problem that WeChat's built-in browser is not compatible with floating _html/css_WEB-ITnose?

WBOY
WBOYOriginal
2016-06-24 12:26:141515browse

<!DOCTYPE HTML><html><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><title>浮动测试</title><style type="text/css">	#mcover {background: none repeat scroll 0 0 rgba(0, 0, 0, 0.7); text-align:right; display:block; height: 100%;left: 0; position: fixed; top: 0; width: 100%; z-index: 2000000;}</style><meta name="description" content="" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /></head><body>	<div style="width:310px; height:1000px; margin:0px auto; border:1px #000000 solid">			<div style="" onclick="document.getElementById('mcover').style.display='';" id="mcover"><img src="http://img.my.csdn.net/uploads/201401/11/1389420919_5249.png"></div>			</div></body></html>

This page can be floated in ordinary browsers on PCs and mobile devices. That is, when the mouse is scrolled, the top layer remains unchanged. However, in the built-in browser of WeChat, it is invalid. , I came here to ask for help, thank you very much.


Reply to the discussion (solution)

Let’s see if this is a problem caused by fixed positioning.

Change the fixed positioning to absolute positioning, and then see if it works normally. If it works, it means that WeChat browser does not support fixed positioning.

Search: Solving fixed positioning under IE6. This, let’s see how IE6 handles the fact that it does not support the fixed attribute.

Then try changing it here.

Also, aa17f4fc4bd6b75910dc6dda82fefc38 Remove this section and try again. Don't force the browser's parsing mode.

Let’s ask this question. Let’s see if fixed positioning is causing trouble...
In fact, there is no need to be compatible with PC browsers. It only needs to be compatible with mobile device browsers. Now mobile device browsers are almost It is compatible with all, except WeChat’s built-in browser. We are currently solving this problem

What I am saying is that the solution to your problem is that the WeChat browser uses Tencent’s own browser. Tencent All browsers are based on IE.

So I thought about whether this problem was caused by not supporting the fixed attribute.

Also, you added the forced parsing in IE's latest mode and chrome=1 mode. Will this have any impact? This is just to further confirm the root cause of the problem.

I’m just saying...
Haha I know what the problem is. It turns out to be a problem with the mobile phone system version. I found other mobile phones to test. There is no problem with the code. Thank you

Statement:
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