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

jQuery .height() and .width() don't include padding and border #14

Open
cheton opened this issue Jan 23, 2014 · 6 comments
Open

jQuery .height() and .width() don't include padding and border #14

cheton opened this issue Jan 23, 2014 · 6 comments

Comments

@cheton
Copy link

cheton commented Jan 23, 2014

jQuery .height() and .width() are not equivalent to offsetHeight and offsetWidth since they don't include padding and border.

If we want to override the default splitter style with padding and border, the calculated height and width will be incorrect.

You can replace splitter.width() and splitter.height() with splitter.get(0).offsetWidth and splitter.get(0).offsetHeight, respectively, to overcome this issue.

@plashenkov
Copy link
Contributor

It is better to use jQuery-style: splitter.outerWidth() and splitter.outerHeight() to include padding and border.

@NT-Christ
Copy link

Regardless the current version of this splitter is useless without this fix. Do you guys have a modified version that fixes this? I don't see anything forked.

@kriede
Copy link

kriede commented Nov 21, 2014

It seems that on January 23, 2014 plashenkov introduced usage of $.outerWidth() and $.outerHeight().
But if the panels have borders, their size is still not computed correctly.
I'll try to find a solution...

@kriede
Copy link

kriede commented Nov 26, 2014

Created a pull request to fix this issue, see my branch patch-1

@jcubic
Copy link
Owner

jcubic commented Aug 31, 2015

Hey @kriede do you want to merge this with original jcubic/jQuery.Splitter because you created pull reqest to the fork?

@kriede
Copy link

kriede commented Sep 1, 2015

Yes, would be good to have it in the original branch.

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

5 participants