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

Window innerHeight Calculation uses incorrect DOM value due to timing issue #38

Open
robvon opened this issue Jul 31, 2017 · 0 comments

Comments

@robvon
Copy link

robvon commented Jul 31, 2017

In setHeight(), when used for a WINDOW
setHeight: function (height) {
var me = this;
me.$el.css('height', me._calculateHeight(height))
.find('.lobibox-body')
.css('height', me._calculateBodyHeight(me.$el.innerHeight()));
return me;
},

When using a specific 'height', The call to me.calculatBodyHeight occurs before the change to $el.height just above has taken effect resulting in an incorrect value for $el.innerHeight(). You need to allow the element to render it seems before you can read the $el.innerHeight correctly.

As a simply work around I've only managed to use window.setTimeout. Its not pretty. Perhaps you could work out a better way....

maybe... just set the height to '100%'. I just tried it and it works. Its an inner height after all

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

1 participant