These files contain a basic template for creating customized social media share buttons on a web page. The CSS styles are arbitrary, and easily changes. The HTML and JavaScript works as follows.
The buttons are simply a
elements with no href
value. Font Awesome is used to add icons. The IDs are used by the JavaScript to modify these a
elements.
This file uses jQuery.
Three functions are defined to find share counts for Facebook, Twitter and LinkedIn. Google+ is currently excluded.
The web page address is grabbed by window.location.href
and encoded. The page title is pulled from whatever HTML element has id="title"
. The share count functions are called, and the results appended to the inner text of the share buttons. The the href
of each button is changed to the appropriate URL for sharing the webpage.