<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/"
     xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Tyler Cipriani: Cross-Browser JavaScript Scrollbar Detection</title>
<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/</link>
<atom:link href="https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comments.rss" rel="self" type="application/rss+xml"/>

<copyright>Copyright © 2017 Tyler Cipriani</copyright>

<description>Tyler Cipriani</description>
<generator>ikiwiki</generator>
<pubDate>Wed, 13 Jun 2018 19:34:11 +0000</pubDate>
<item>
	<title>comment 1</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comment_1_d692aec480382f1feb603775b1eb3b43/</guid>

	<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/#comment-92ec281ac89e347be9720b0882730ce0</link>

	<dc:creator>ilycite</dc:creator>


	<pubDate>Sun, 25 Jan 2015 02:53:12 +0000</pubDate>
	<dcterms:modified>2018-06-13T19:34:11Z</dcterms:modified>


	<description>&lt;p&gt;Hello, great work. I adapted your code to let the possibility to chose on which axe the check is made. Here the code : &lt;a href=&quot;https://gist.github.com/numee/1e7a19cd26113323f1ae#file-hasscrollbar&quot;&gt;https://gist.github.com/numee/.. .&lt;/a&gt;.&lt;/p&gt;

</description>


</item>
<item>
	<title>comment 2</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comment_2_87255105c68d92f7653d4f5ef7a807fb/</guid>

	<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/#comment-5f410750fdb1ccaf331d1764d01bbc14</link>

	<dc:creator>clottes.code</dc:creator>


	<pubDate>Fri, 17 Jul 2015 13:35:13 +0000</pubDate>
	<dcterms:modified>2018-06-13T19:34:11Z</dcterms:modified>


	<description>&lt;p&gt;// rootElem for quirksmode&lt;/p&gt;
&lt;p&gt;var rootElem = document.documentElement || document.body&lt;/p&gt;
&lt;p&gt;shouldn’t you be checking if the clientHeight of document is 0 (not that documentElement exists) when assigning rootElem… (if I’m following your resoning above)&lt;/p&gt;
&lt;p&gt;isn’t this what you mean:?&lt;/p&gt;
&lt;p&gt;var rootElem = document.documentElement&lt;/p&gt;
&lt;p&gt;if(!rootElem.clientHeight) rootElem = document.body&lt;/p&gt;

</description>


</item>
<item>
	<title>comment 3</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comment_3_6c38fd1605b818f290322b062c4d6cce/</guid>

	<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/#comment-71462ced4f857a1102514a2a4f1a6ac8</link>

	<dc:creator>clottes.code</dc:creator>


	<pubDate>Fri, 17 Jul 2015 13:39:47 +0000</pubDate>
	<dcterms:modified>2018-06-13T19:34:11Z</dcterms:modified>


	<description>&lt;p&gt;Note: that rootElem in my previous comment would only be viable then in the rest of the code for calculating things available on that element and would require changing, my point is rootElem will always be document.documentElement (because it exists in IE8 if I’m not mistaken)&lt;/p&gt;

</description>


</item>
<item>
	<title>comment 4</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comment_4_d29a0942039bd4e76d848767ea0c7e7f/</guid>

	<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/#comment-014aebc25f7b33d87fb74d38604f0f84</link>

	<dc:creator>ashraf.reda.m</dc:creator>


	<pubDate>Sun, 17 Jul 2016 02:49:20 +0000</pubDate>
	<dcterms:modified>2018-06-13T19:34:11Z</dcterms:modified>


	<description>Works Great, Thanks..
</description>


</item>
<item>
	<title>Great stuff</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comment_5_6b75facb84407c1d7f52bf93f411db56/</guid>

	<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/#comment-5cb2d9a051e4aa616cd9a09026841890</link>

	<dc:creator>franciskim</dc:creator>


	<pubDate>Thu, 01 Dec 2016 04:42:55 +0000</pubDate>
	<dcterms:modified>2016-12-01T04:42:56Z</dcterms:modified>


	<description>Seems like the best answer I’ve found to this problem, thank you.
</description>


</item>
<item>
	<title>Using the code</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comment_6_0d1a9d858600fd24c7e8cfede74fcf60/</guid>

	<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/#comment-75dba0279c2b2934bad6cdd94bf6eb43</link>

	<dc:creator>glinnewe</dc:creator>


	<pubDate>Wed, 29 Mar 2017 14:44:06 +0000</pubDate>
	<dcterms:modified>2017-05-05T18:36:13Z</dcterms:modified>


	<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the great write up!&lt;/p&gt;
&lt;p&gt;Could you please go until a bit more detail regarding how we would apply the code?&lt;/p&gt;
&lt;p&gt;For example, I’d like to do a check to see if the scrollbar exists and is pushing the content over and, if so, then add a class to the body. How would this be done?&lt;/p&gt;
&lt;p&gt;I basically want to be able to do the following:&lt;/p&gt;
&lt;p&gt;if ( hasScrollBar ) { $(‘body’).addClass(‘window_has_scrollbar’); }&lt;/p&gt;

</description>


</item>
<item>
	<title>Works very well</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/comment_7_c18ca1a381df8789006adac9f8e92777/</guid>

	<link>https://tylercipriani.com/blog/2014/07/12/crossbrowser-javascript-scrollbar-detection/#comment-9f6a47b0ca37271ae708d7b0eba1164c</link>

	<dc:creator>riophaelee</dc:creator>


	<pubDate>Sat, 13 May 2017 18:17:05 +0000</pubDate>
	<dcterms:modified>2017-05-13T18:17:06Z</dcterms:modified>


	<description>Thank you!
</description>


</item>

</channel>
</rss>
