How to Create a Share Button Like Google

How to Create a Share Button Like Google. I was given the opportunity to share, on this occasion I will share a tutorial on How to Create a Button Share Like Google! Very simple and useful course for you who has a lot of articles. It is different with the AddThis plugin and share button others. Share Button which I will share is using a custom blogger conditional tag, when someone visits the page posts / articles, then Google Share button will appear with Popup Share after all the content in the article page / posts loaded by the browser. You can see the demo below.

How to install :

1. Login Blogger
2. Click the " Template" → " Edit HTML "
3. Make sure the friend already storing external code jQuery library below, immediately before the </head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>
Note : JQuery library code can only be installed 1x course, if my friend had put jQuery code library skip this step, because it will lead to conflict and make all of the jQuery code will not work.

4. Save all the below code just above the code <div class='comments' id='comments'>.

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<style type='text/css'>
.overlay {
position:fixed;
z-index:+100000;
top:0;left:0;
width:100%;
height:100%;
background:white;
opacity:.8;
}
.google-share {
border:1px solid #aaa;
background:white;
padding:33px;
width:570px;
max-width:95%;
position:fixed;
z-index:+100001;
top:100px;
left:50%;
margin-left:-285px;
box-shadow:0px 5px 10px rgba(0,0,0,0.18);
}
.google-share h3 {
clear:both;
margin:0px!important;
margin-bottom:20px!important;
font-size:20px!important;
font-weight:normal;
color:#333;
}
.google-share h3 span.close {
float:right;
cursor:pointer;
font-size:25px;
}
.google-share img { margin:5px;margin-right:0px; display:inline-block; border-radius:2px; transition:all .3s ease; }
.google-share img:hover { opacity:.7; }
.google-share span.small {
font-size:14px!important;
font-family:arial,sans-serif!important;
color:#484848;
}
.google-share input {
border:1px solid #ccc;
width:80%;
}
.share img {
position:fixed;
z-index:+1000;
top:200px;
left:0;
background:#fff;
padding:10px;
border-radius:0 3px 3px 0;
border:1px solid #ddd;
}
.share img:hover {
opacity:.7;
cursor:pointer;
box-shadow:0px 3px 0px rgba(0,0,0,0.14);
top:197px;
}
.share img:active {
box-shadow:none;
top:200px;
}
@media screen and (max-width : 640px) {
.google-share, .overlay, .share { display:none!important;}
}
</style>
<div class='share'>
<img alt='share' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7w2IU13ALDTVD5PGACKKMGtWaSmrEMY6FKU72nLR80GAH8ND7Dl3Xur3j1E8wu9eXpaot_MonC-vy0GWpWLDxfLP5MqPz5Jrl1ZeWgbngQu7FrgoWbcnobXdLHSTBeIZpCAR1K637iD4/s1600/share.png' title='share!'/>
</div>
<div class='overlay' style='display:none;'/>
<!-- White Overlay -->
<div class='google-share' id='google-share' style='display:none;'>
<h3><data:post.title/><span class='close'>&#215;</span></h3>
<span class='small'>Click to share in:</span><br/>
<a expr:href='&quot;https://plus.google.com/share?url=&quot; + data:blog.canonicalUrl' target='_blank' title='share di Google+'><img alt='Google Plus Icon' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGiw2v6A8CAPI_RcMxTiTpLFxHt5mGfWfj974Az_9Kc9BR25wsROujXbf7ENVdiklMNNDqIlaRCW1s-UmvuZk-_XaSjsLv8UhFbX1pDztzWfLfa2M6EZQJyEGDbUr0vFhlMhI7C4Z2ew0/h33/gplus.png'/></a>
<a expr:href='&quot;https://www.facebook.com/sharer/sharer.php?u=&quot; + data:blog.canonicalUrl' target='_blank' title='share di Facebook'><img alt='Facebook Icon' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCOoAlX9t2x00P5GRBQyHDWJ1n8B90lKaeSMowi8gwT1Eb0KvxYZ-UIMvAgRzL_GTiIwSymz1p37Q39znz1akFy288I1kXWkSVRAvImWufAS4HQSvxiPCDqbujXtqHoeVDW8R9xCWvcx4/h33/fb.png'/></a>
<a expr:href='&quot;https://twitter.com/intent/tweet?text=&quot; + data:post.title + &quot;&amp;amp;url=&quot; + data:post.url' target='_blank' title='share di Twitter'><img alt='Twitter Icon' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh30t1C4v8K8W0RUzx9rh_acFv6_vVKefrQfQ67PGzw_cF4_kcclB7I-KNnm22j9IapfSAHhALYZuxmJeAB50R-91V8_Xd8Av2079NPw_w_b4ttoEGY8PaQxS7FoPXHAo02b2UmpT-d2ek/h33/t.png'/></a>
<a expr:href='&quot;mailto:?subject=&quot; + data:post.title + &quot;&amp;amp;body=&quot; + data:blog.canonicalUrl' target='_blank' title='share via Email'><img alt='Email Icon' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM3JU8_TvKy_FvG04ReR4GJ2b58LweQ_3Xsnk_0klLutFHqthVJ4FhEGBdBhDA5n_HuQ_yqiYD44PWJlNPB8M1iQKvz8eotevC0hfDRihL8H7sX6kZE5cQe9cBERW4aHghYHCM1ldjiQM/h33/m.png'/></a>
<br/>
<span class='small'>Or copy link:</span><br/>
<input expr:value='data:blog.canonicalUrl' readonly='readonly' type='text'/>
</div>
<script type='text/javascript'>
//<![CDATA[
$(window).bind("load", function() {
$('#google-share, .overlay').fadeIn(1000);
$('#google-share input').select();
});
$('#google-share input').click(function() {
$('#google-share input').select();
});
$('.share').click(function() {
$('#google-share, .overlay').fadeIn(500);
$('#google-share input').select();
});
$(document).ready(function() {
$('.close, .overlay, #google-share img').click(function() {
$('#google-share').hide();
$('.overlay').hide();
});
});
//]]>
</script>
</b:if>

Finally click save, Share Button Like Google will appear on your blog. It will appear when visitor visit your site and make them easy to share your post.


I hope this tutorial can be a sollution for your blog. You did not need other share button that will spend a lot of place at your theme.
Advertisement

Tidak ada komentar