Open newbie78 opened 9 years ago
@newbie78 thank you for the suggestion!
Personally I don't think this should be part of Core. Adding a div
to the DOM should be avoided, even if its a valid way to retrieve the scroll-bar width. Reminds me of this other way in Stackoverfow.
Maybe this would fit More, or a separate plugin better than Core.
I will close this soon if no one has a different opinion.
this won't scale as you can override scrollbar widths on a per-element basis based upon cascading styles.
eg.
::-webkit-scrollbar {
width: 7px;
height: 7px;
}
.dark ::-webkit-scrollbar {
width: 12px;
height: 12px;
}
... which means you can only truly measure scrollbar width on an element by injecting exactly where the element is (hopefully not in conflict with n-th child selectors)... I'd write this as a plugin or possibly mootools-more
- extending http://mootools.net/more/docs/1.5.1/Element/Element.Measure
it would seem to me to add to the core or more not badly