Saturday, July 27, 2013

JavaScript: Google+ Button (without Library)

Google Plus gigantic logo
This is very simple, taken from the Google+ Developers "share bookmarklet". With this, you don't have to load JavaScript from Google Plus - meaning you'll minimize extra time for pulling in external resources.

This is a bit modification of the bookmarklet. I just imitate how Facebook does it.


The phrase "Share on G+" can be replaced by an image, or your own CSS button.


Examples - clickable

With image 32px
Image with CSS
Only CSS button
Share on G+

You can use your browser's "inspect element" to see the styling there. Very simple. And I suppose you can make your own buttons. I have plenty of examples here on Monkey Raptor and Monkey Raptor's CodePen Page. Or just browse CodePen or Google, search for CSS button.

Anyway, the image of Google Plus button can be found on Share documentation at Google Plus Developers.


I also posted about bunch of social media buttons sharer on this blog, also without pulling external resource.

There you go. Have fun! :)

No comments:

Post a Comment

Tell me what you think...