shahinsaifullah2006
New Member
FIDDLESo, I've been trying to get a good jQuery way to find a client's scrollbar width. I thought I had it figured out in my fiddle, but apparently the addition of a scrollbar does not change anything of the child's width. EVEN THOUGH in dev tools (chrome, FF) the width has decreased.\[code\]function scrollbarWidth() { var div = $('<div class="outer"><div class="inner"></div>'); $('body').append(div); var w1 = $(".inner").width(); $(".test-text span:first").text(w1); console.log(w1); $(".test-div").css('overflow-y', 'scroll'); var w2 = $(".inner").width(); $(".test-text span:last").text(w2); console.log(w2);}scrollbarWidth();?\[/code\]Using \[code\]innerWidth\[/code\] doesn't make a difference.How is this possible and what is a solution?