Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我加入了以下CSS后就不能正常使用了,我想让.mevos-con下面的图片宽、高都为100%铺满。 #8

Closed
cocca883 opened this issue May 24, 2016 · 2 comments

Comments

@cocca883
Copy link

cocca883 commented May 24, 2016

我加入了以下CSS后就不能正常使用了,我想让.mevos-con下面的图片宽、高都为100%铺满。
css效果是实现了,整个屏幕铺满。
但,我找了原因,是93行:
if (height > pageHeight) {
$this.data('height', height);
$this.css('overflow', 'auto');
}
的height > pageHeight造成的,微信浏览器的document.documentElement.clientHeight设计计算是否与其它浏览器不一致?
以下代码我在“微信WEB开发者工具中 V0.6.0”都是正常的,但在真机中不正常。
`<style>
.mevos-con, .mevos-con img{
font-size: 0;
height: 100%;
width: 100%;
}
</style>

`
@littledu
Copy link
Member

有没有一条链接我看一下?你这里是子元素高度大于屏幕高度了,你可以尝试一下把图片绝对定对

.mevos-con, .mevos-con img{ position: absolute; left: 0; top: 0; font-size: 0; height: 100%; width: 100%; }

@cocca883
Copy link
Author

对,js计算子元素高度大于屏幕高度了,但屏幕只有一页面,刚好铺满,应该是两者两等才对,我可以给你个链接,但我需要启动我本地机器,加下我QQ吧:171339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants