woops that one was fast Arian :-)

Well i was reading David's Blog but it seems i overlooked it. Thanks
for the pointing - seems i slightly goes the same way with the
calculations but his approach of using a div seems more crisp.

*lays down and praise the day the Highlord Walsh was born*

On 30 Okt., 16:51, Arian Stolwijk <[email protected]> wrote:
> You're not reading davidwalshblog?! 
> —http://davidwalsh.name/detect-scrollbar-width
>
>
>
>
>
>
>
> On Sun, Oct 30, 2011 at 4:49 PM, Fli7e <[email protected]> wrote:
> > Hi,
>
> > i recently was in need of the exaxt Pixelsize of the client's
> > scrollbars. After searching up and down the web i came up with the
> > following function (its not something special) - which has been
> > inspired by several sources:
>
> >                        getScrollbarSize: function()
> >                        {
> >                                var db = document.body;
> >                                var prevOverflow = db.getStyle('overflow');
> >                                db.setStyle('overflow','hidden');
> >                                var w = db.clientWidth;
> >                                var h = db.clientHeight;
> >                                db.setStyle('overflow','scroll');
> >                                var S1 = {
> >                                        'width' : w -= db.clientWidth,
> >                                        'height' : h -= db.clientHeight
> >                                };
> >                                if(!S1.width) S1.width = db.offsetWidth -
> > db.clientWidth;
> >                                if(!S1.height) S1.height = db.offsetHeight
> > - db.clientHeight;
> >                                db.setStyle('overflow',prevOverflow);
> >                                return S1;
> >                        }
>
> > Is there any mootools internal function i overlooked or is there any
> > better crossbrowser way of doing the calculations? I saw jQuery is
> > using textarea stuff and browser dependant divs .. i tried their code
> > (converted to moo / native JS) but was never realy working (only in
> > mozilla).
>
> > Any Feedback appreciated
>
> > Thanx

Reply via email to