问题
After I included this iframe[src^="https://apis.google.com"] {
display: none;
}
to suppress Google+ Sign-in Welcome Back Message, my Google+ Interactive post share button stopped showing when I click on the share button rather it just shows a faded white screen but when I remove or change the iframe display to visible
, the interactive post button starts working.
Please does anybody know what I can do to make the interactive post start working while still leaving the iframe attribute to display:none
?
回答1:
This question covers one way to suppress the message but it looks like you are doing this already. For some folks, using the iframe regex to suppress the welcome message works - however, could be what is causing the issue when rendering the interactive post and you should be able to get by without it. There still could be other causes specific to your page so you might want to start with a simple version and debug from there.
The following code is working for me - note that I am not using the regex at all but the message still gets hidden:
<html>
<body>
<script src="https://apis.google.com/js/plusone.js">
isSignedOut: true
</script>
<button
class="g-interactivepost"
data-contenturl="https://plus.google.com/pages/"
data-contentdeeplinkid="/pages"
data-clientid="268858962829.apps.googleusercontent.com"
data-cookiepolicy="single_host_origin"
data-prefilltext="Engage your users today, create a Google+ page for your business."
data-calltoactionlabel="CREATE"
data-calltoactionurl="http://plus.google.com/pages/create"
data-calltoactiondeeplinkid="/pages/create">
Tell your friends
</button>
</body>
</html>
You can see the demo in action here. Again, note that I am not setting the iframe visibility to none and it is working for me in Chrome.
A final note, you might not want to hide the message because it's a great feedback mechanism for letting the user know that they are being signed-in to your site. The message only appears the first time a user reaches your site in a browsing session.
来源:https://stackoverflow.com/questions/20841660/google-interactive-post-button-shows-blank-white-screen-on-click