Google Plus & Javascript. Turn off scrolling when selecting laps?

I created a lot of Circles. So when I click the google plus 'Add to circles' button, a small div appears that allows me to scroll my circles vertically.

The really cool part is that it disables body scrolling. Therefore, when I look at the bottom of the circle viewer, the body does not budge.

How is this possible with javascript?

(I found a hacker way to do this:

$('body').css({'overflow':'hidden'}); $(document).bind('scroll',function () { window.scrollTo(0,0); }); 

But Google is doing it better. The body scrollbar remains in place (it does not disappear, as my code does), and the body still cannot be analyzed ...)

It is important to note (and not to lose sight of) that the scroll bar on the main page should remain in place. It cannot disappear like an overflow: the hidden one does this because it pushes the entire contents of the page to the right. Google solves this problem somehow ...

SCREENSHOT: enter image description here

+4
source share
1 answer

Try using:

 $(document).bind('scroll',function (e) { e.preventDefault(); e.stopPropagation(); return false; }); 
0
source

All Articles