google +1 button adds scroll bar to my site
Asked Answered
C

3

5

I have had a google +1 button on my site for more then a year and it all worked fine.

In the last couple of days this button started to create a horizontal scroll bar on my site.

I know that beacase when I remove the button the scroll bar disappears.

Here is my site: www.kitchen-guide.co.il

Any suggestions what should I do?

Thanks!

Choosy answered 26/8, 2013 at 5:34 Comment(3)
hebrew site! cool ive never seen that beforeParadies
Very good information how i can add scrolling button to my blog this is my blog www.urexamsyllabus.blogspot.comZina
make body overflow-x:hidden;Tweeny
L
12

borrowing from superware's answer, was having the same problem... however, this worked for me:

iframe[id^="oauth2relay"] { position: fixed !important; }
Lacerated answered 1/10, 2013 at 17:25 Comment(1)
For me worked changing position: fixed to display: none, thanks! ;)Derryberry
S
4

Google's +1 button is adding the following iframe to the end of the page body:

<iframe name="oauth2relayXXXXXXXXX" id="oauth2relayXXXXXXXXX" src="https://accounts.google.com/o/oauth2/postmessageRelay?parent=http%3A%2F%2Fwww.example.com#rpctoken=XXXXXXXXX&amp;forcesecure=1" style="width: 1px; height: 1px; position: absolute; left: -100px;"></iframe>

One workaround (to this Google bug) can be to include the following rule in your CSS:

iframe[id^="oauth2relay"] { left: auto !important; right: -100px !important; }

If your website is all RTL then it should work fine, but if it's also LTR (multilingual) you will have to somehow target that role on RTL pages only. Check resizenow.com.

Salad answered 27/8, 2013 at 18:5 Comment(0)
R
0

The iframe is no longer used to render the information bubble. therefor, the previously suggested solution will not work anymore.

To fix the issue define the data-onendinteraction callback attribute.

<div class="g-plusone" data-onendinteraction="gplusoneinteraction"></div>

Then, implement the interaction callback function:

window.gplusoneinteraction = function(params) {
    $('iframe[id^="oauth2relay"]').next('div').css({left: 0, right: '-10000px'});
}
Routh answered 5/7, 2014 at 14:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.