Business Premium email | AI Website Builder | KVM 2 VPS Hosting
Cheaper Cloud Hosting | Business Web Hosting
  • Our Services
  • Press Releases
  • Hosting Hub
  • Sitemap
  • Login
  • Our WordPress Plugin
  • Blog Posting Services
  • In Twitter
  • In LinkedIn
J
HARAPHULA
OneStop Shop of Information

Updates

  • The best Guest Posting Website to boost your Online Presence
    •
  • Why Web2 Guest Posts Backlinks matters for Google Ranking?
    •
  • How Paid Guest Posting Services Help for SEO Backlinks?
    •
  • Why Guest Posting is a best approach to boost Products Sales?
    •
  • Do-follow links from Guest Posting how affecting Ranking
    •
  • Free Guest Posting in LinkedIn or Medium Accelerate Indexing
    •
  • Should I go for paid Guest Posting with No-follow links?
    •
  • Tricks for Lead Generation using Guest Posting deep links
    •
  • How Guest Posting Services useful for SEO Backlinks & Ranking?
    •
  • Why I will Choose Link Insertion in place of fresh Guest Posting with link?
    •
  • Quality Backlinks or Lead Generation when to use Guest Posting Service?
    •

Script to Add Custom Social Sharing buttons using JQuery?

Blogging Techniques
May 8, 2017
2.6 (34 votes)
Script to Add Custom Social Sharing buttons using JQuery? Script to Add Custom Social Sharing buttons using JQuery?
3 5 87
Our Services | Use AYURVEDA to bring Colors in your Living

Today Social Media’s are the best ways to bring free real human traffic to your Blog. As you know Google hates artificial backlinks. It is more fruitful for your portal if visitors will start sharing. This practice helps to gain popularity and ranking. Assume you have your blog related to Fashion industry. Every day nearly 200 readers redirects to your blog through Search engines. Here if your portal provides share option, it may 10 readers like your content and share the link in their network. Which will directly helps to bring referral traffic. It was noticed referral traffic helps to generate better Return on Investments.

With this idea recently we introduced Social media Sharing buttons in our blog. My blog is designed using WordPress. While I searched for Social Sharing buttons plugin in WordPress, I got many. But refer to my requirements in my blog I want Custom Social Sharing buttons. I have icon files for Facebook, Twitter and LinkedIn. What more I want is while users will click on these icon files a centered aligned Popup will open. Where my visitors can easily share the link without wasting much of their quality time.

To achieve the same did start with the implementation. Downloaded 3D social media icon images from iconfinder.com. Placed them in side my HTML file using a UL element as below.

Adding Social Sharing icons

<ul class="ulstyle">
<li class="listyle">
<a class="fb-share" target="_blank">
<img src="https://jharaphula.com/wp-content/uploads/2016/05/ico-facebook.png" alt="Facebook" title="Facebook" />
</a>
</li>
<li class="listyle">
<a class="tw-share" target="_blank">
<img src="https://jharaphula.com/wp-content/uploads/2016/05/ico-twitter.png" alt="Twitter" title="Twitter" />
</a>
</li>
<li class="listyle">
<a class="gp-share" target="_blank">
<img src="https://jharaphula.com/wp-content/uploads/2016/05/ico-google_plus.png" alt="Google Plus" title="Google Plus" />
</a>
</li>
<li>
<a class="ln-share" target="_blank">
<img src="https://jharaphula.com/wp-content/uploads/2016/05/ico-linkedin.png" alt="LinkedIn" title="LinkedIn" />
</a>
</li>
</ul>

CSS Styles

.ulstyle {
list-style: outside none none; 
overflow: hidden; 
width: 247px; 
margin: auto;
}
.listyle {
float: left; 
padding-right: 18px;
cursor: pointer;
}
.ln-share {
cursor: pointer;
}

Now what more remain? Yes, to make Social Sharing Functional I have to post parameters like URL or page Title to Social media Sharing APIs. In this scenario I required 4 top Social Medias Facebook, Twitter, Google Plus and LinkedIn. The Social Sharing API’s for these 4 popular Social networking sites are as below.

Facebook – http://www.facebook.com/share.php?u=[URL]&title=[TITLE]
Twitter – http://twitter.com/intent/tweet?status=[TITLE]+[URL]
Google Plus – https://plus.google.com/share?url=[URL]
LinkedIn – http://www.linkedin.com/shareArticle?mini=true&url=[URL]&title=[TITLE]&source=[SOURCE/DOMAIN]

Here to achieve Social Sharing Pop-up’s on click of icon images I did write 4 jquery functions inside document.ready method. These functions are called over the click event of icon images. To open a popup with Social Sharing API’s here I am using the traditional JS window.open method. Using simple calculation aligning these pop-up’s to center. Look at the Script below.

$('.fb-share').click(function(e) {
e.preventDefault();
window.open('https://www.facebook.com/sharer/sharer.php?u=' + location.href + '', 'fbShareWindow', 'height=396, width=630, top=' + (jQuery(window).height() / 2 - 198) + ', left=' + (jQuery(window).width() / 2 - 315) + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
return false;
});

$('.tw-share').click(function(e) {
e.preventDefault();
window.open('http://twitter.com/intent/tweet?status=<?php the_title(); ?>' + ' ' + '' + location.href + '', 'twShareWindow', 'height=396, width=630, top=' + (jQuery(window).height() / 2 - 198) + ', left=' + (jQuery(window).width() / 2 - 315) + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
return false;
});

$('.gp-share').click(function(e) {
e.preventDefault();
window.open('https://plus.google.com/share?url=' + location.href + '', 'gpShareWindow', 'height=556, width=404, top=' + (jQuery(window).height() / 2 - 278) + ', left=' + (jQuery(window).width() / 2 - 202) + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
return false;
});

$('.ln-share').click(function(e) {
e.preventDefault();
window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + location.href + '&title=<?php the_title(); ?>&source=https://jharaphula.com', 'lnShareWindow', 'height=580, width=630, top=' + (jQuery(window).height() / 2 - 290) + ', left=' + (jQuery(window).width() / 2 - 315) + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
return false;
});

In the above Script thing to notice is in place of URL I am passing location.href. Which results the current page URL to share.

Tags:Advantages using Jquery, Custom Social Sharing buttons, Sharing buttons using JQuery, Utilize Social Media
6 Crucial WordPress Skills to Manage your Blog
5 Devices to Fix Wi-Fi Deadspots from Netgear Universal and Cisco

Related Posts

  • White hat SEO tricks to increase Organic Traffic for…
  • Techniques behind successful Link building strategies
  • Tricks for free Internet traffic for your Site…
  • Facebook for Business to drive massive visitors to your Blog
  • Basic SEO Interview Questions & Answers for Freshers
  • Off Page Optimization Activities those Affects…
  • How to increase Site traffic using Organic Search?
  • Why I will Choose Link Insertion in place of fresh…
  • Tips to Write a Comment with list of Blog Commenting Sites
  • Top High PR Social Media & Social Bookmarking Sites
  • How Guest Posting Services useful for SEO Backlinks…
  • How Competitor Analysis & Keyword Research helps in SEO?
  • Tips for Google Penalty Recovery from Penguin Updates
  • 5 Proved Ways for E-Commerce Stores to Drive Organic…
  • Google Recovery Penalty removal Tricks for Bloggers
  • How your Blog Can help you to Create Brand Personality?
  • Ways to make Money Online - Tips to increase Google…
  • How Google Analytics reports help in Business Growth?
  • Basic and Easy Tips for Creating an SEO Friendly Blog Posts
  • Free Backlinks Submitter tools to generate 2000+…
  • Why Web2 Guest Posts Backlinks matters for Google Ranking?
  • On-page Optimization tricks to reduce Google…
  • Difference between Social Media Marketing & Bookmarking?
  • Need Guest Posting Sponsors for your Blog? Try…
  • Types of Website Traffic Sources to Generate Leads…
On-page SEO booster,
Google Friendly,
XML based
PHP/WP Sidebar
FREE Widgets
demo

Our Web2 Blogs

Blog for Home Remedies
Hosting Shop
Digital Marketing Blog
Publishing Services
Indian Blog
Blog Posting Services
KVM 8
Cloud Enterprise
AI Website Builder
Business email

Popular Categories

  • Miscellaneous589
  • Digitalization298
  • Career Guide244
  • Indian Blog207
  • Business Book177
  • Health & Wellness168
  • Travel & Tourism132
  • Your Financial Advisor120
  • Real Estate Consulting111
  • Shopping97
  • Digital Marketing78
  • Blogging Techniques78
  • Home Remedies70
  • SEO Techniques67
  • Programming62
  • Automobiles57
  • Fashion & Fantacy53
  • Easy Recipes52

Our Facebook Groups

paid Guest Posting Services with lifelong Links

SEO Backlinks, Guest Posting, Link Insertion plus Link Exchange hub

Instant Guest Posting Services with lifelong Do-Follow links

Guest Posting SEO Services with High DA aged Domains

Free or Paid Guest Posting Service in India | UK | USA

Free Guest Posting, Link exchange, SEO, SEM, PBN links, web2 links

Cheap Guest Posting Services with high Authority Blogs

Cloud Startup
KVM 2
Starter email
AI Website Builder

i20 Sidebar Widgets

New Releases

YouTube Advertising Advantages, Limitations and best Practices
July 12, 2025

YouTube Advertising Advantages, Limitations and best Practices

YouTube has become one of the most influential digital platforms for advertising, offering businesses a dynamic way to reach global audiences. With billions of users…

b2b Email Marketing jobs and ZOHO Campaigns for professionals
July 7, 2025
b2b Email Marketing jobs and ZOHO Campaigns for professionals
YouTube Marketing Techniques to minimize Advertising Costs
July 2, 2025
YouTube Marketing Techniques to minimize Advertising Costs
Natural Hair Plantation for Women of any Age no Surgery
July 1, 2025
Natural Hair Plantation for Women of any Age with no Surgery
Eyeliner for Hooded Eyes to apply before applying Eyeshadow
July 1, 2025
Eyeliner for Hooded Eyes to apply before applying Eyeshadow
Comparing Paid and Free Website Builder for Small Business
July 1, 2025
Comparing Paid and Free Website Builder for Small Business
Google Search Console for SEO Tools for every Webmaster
July 1, 2025
Google Search Console for SEO Tools for every Webmaster
Digital Marketing Guest Post best practices to boost Sales
July 1, 2025
Digital Marketing Guest Post best practices to boost Sales
Deep Stretch Marks on Thighs and Belly during Pregnancy
June 26, 2025
Deep Stretch Marks on Thighs and Belly areas during Pregnancy
Fade Pregnancy Stretch Marks appear as Streaks or Lines on the Skin
June 26, 2025
Fade Pregnancy Stretch Marks appear as Streaks or Lines on the Skin
The best Guest Posting Website to boost your Online Presence
June 26, 2025
The best Guest Posting Website to boost your Online Presence
Digital Marketing Firms for Startup WordPress Blogs
June 25, 2025
Hi-Tech Digital Marketing Firms for Startup WordPress Blogs
Best Foods and 7 Day Diet Plan for Weight Loss help for Housewives
June 25, 2025
Prescribed Best Foods with 7 Day Diet Plan for Weight Loss Journey
Advanced Stage 3 Breast Cancer in Men and Women
June 25, 2025
Advanced Stage 3 Breast Cancer in Men and Women but Treatable
Explain Digital Marketing to Content Marketers for Leads
June 25, 2025
Explain Digital Marketing to Content Marketers for Sales Leads
Best Digital Marketing Agencies to boost AdSense Earning
June 24, 2025
Best Digital Marketing Agencies to boost AdSense Earning
Termites in House? Pest Control Services to Save Damage
June 24, 2025
Termites in House? Pest Control Services to Save Damage
ICICI Bank Vehicle Loan for newly Opened Transportation Agencies
June 24, 2025
ICICI Bank Vehicle Loan for newly Opened Transportation Agencies
explore us...

Our Videos

10+ yrs Old Indian Blog for Guest Posting
40 lifelong SEO backlinks (tire 1 + tire 2)
Google friendly multi-niche Blog accepting Guest Posting
Page Speed Optimization Services with FCP, LCP, CLS or image Optimization
Cheaper Guest Posting Services
Blog Posting Services with PBN and Web 2.0 Blogs

OUR FACILITIES

  • Login
  • Our Background
  • Privacy
  • WordPress.org

CONTACT INFO

  • Reach us
  • WhatsApp 919096266548

OUR SERVICES

  • Blog Posting Opportunity
  • *.fig, *.psd 2 html
  • Video Ads Designing
  • Setup your WordPress Blog
  • Optimizing Google PageSpeed
  • b2b Gmail IDs

WHY ONESTOP?

We are here to bring high Quality Information. As a multi-niche platform we have spend several years for Collecting various useful Stories. Dream to establish a domain where from you can get all your day today required information. We covers Animals to Zoology.
©2014-2025 JHARAPHULA, ALL RIGHTS RESERVED.
Show Buttons