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

5儿子系统微信下的innerHeight获取错误. #11

Open
zqjimlove opened this issue May 15, 2015 · 3 comments
Open

5儿子系统微信下的innerHeight获取错误. #11

zqjimlove opened this issue May 15, 2015 · 3 comments

Comments

@zqjimlove
Copy link

由于现在的库一加载完就获取window.innerHeight 导致了获取一个1400+的值。
问题详见:http://cure.sinaapp.com/

现在我的解决办法是延迟如下,望修改

setTimeout(function() {
        var slipJS = document.createElement("script");
        slipJS.src = "/statics/scripts/min.slip.js";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(slipJS, s);
        slipJS.onload = slipJS.onreadystatechange = function() {
            var slip = Slip(wrap, 'y')
                .webapp()
                .start(function() {
                    arrowUpElement.style.display = 'none';
                })
                .end(function() {
                    arrowUpElement.style.display = 'block';
                });
        }
    }, 500);
@binnng
Copy link
Owner

binnng commented May 15, 2015

@zqjimlove 感谢,最近也碰到这个问题。

@yuanzx
Copy link

yuanzx commented Mar 22, 2016

遇到过多次在ios下获取高度,宽度有问题,我把 WINDOW_HEIGHT = WIN['innerHeight'];
WINDOW_WIDTH = WIN['innerWidth']; 改为 WINDOW_HEIGHT = document.body.clientHeight;
WINDOW_WIDTH = document.body.clientWidth就一切ok了

@wayou
Copy link

wayou commented Dec 7, 2016

同样1400+高度问题,
获取高度时换成document.documentElement.clientHeight 解决

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

4 participants