Skip to content

Instantly share code, notes, and snippets.

@echenley
Last active August 13, 2016 14:54
Show Gist options
  • Save echenley/bb7be9e8c5b352e61b3d to your computer and use it in GitHub Desktop.
Save echenley/bb7be9e8c5b352e61b3d to your computer and use it in GitHub Desktop.
Responsive Google Plus Widget
<div class="gp-wrap" id="gp-wrap">
<div class="g-page" data-href="https://plus.google.com/102226233421872956936" data-rel="publisher"></div>
<script type="text/javascript">
(function() {
// this guy right here
document.getElementsByClassName('g-page')[0].setAttribute('data-width', document.getElementById('gp-wrap').clientWidth);
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment