This time I will share jQuery Plugin and tutorial about jQuery Plugin To Generate Custom Social Share Links – sharing.jquery.js, hope it will help you in programming stack.
sharing.jquery.js is a minimalist jQuery social sharing plugin which allows to easily share your links on various social networks: Facebook, Twitter, Pinterest, Google Plus and Linkedin.
How to use it:
1. Place jQuery library and the jQuery sharing.jquery.js plugin at the bottom of the html page.
1 |
< script src = "//code.jquery.com/jquery-1.12.1.min.js" ></ script > |
2 |
< script src = "sharing.jquery.js" ></ script > |
2. Create social share links and specify the urls you want to share using href
attribute.
1 |
< a href = "#" class = "tw" >Share on Twitter</ a > |
2 |
< a href = "#" class = "fb" >Share on Facebook</ a > |
3 |
< a href = "#" class = "pt" >Share on Pinterest</ a > |
4 |
< a href = "#" class = "ln" >Share on LinkedIn</ a > |
5 |
< a href = "#" class = "gp" >Share on Google+</ a > |
3. Active the social share links. It will popout a new social share window when you click on links.
1 |
$( ".tw" ).sharing( "<a href=" https: |
2 |
$( ".fb" ).sharing( "facebook" ); |
3 |
$( ".pt" ).sharing( "pinterest" ); |
4 |
$( ".ln" ).sharing( "linkedin" ); |
5 |
$( ".gp" ).sharing( "googleplus" ); |
This awesome jQuery plugin is developed by spacek. For more Advanced Usages, please check the demo page or visit the official website.