The share box will have all the buttons shown inline and partially hidden. When user hovers over a button it slides to the right and become visible. It's a nice effect adding a little bit of style to your posts.
How to create nice share box using CSS and jQuery?
1. Log in to your dashboard--> Design- -> Edit HTML2. Click on "Expand Widget Templates"
3. Search "Ctrl+F" and find ]]></b:skin>. Before it paste the code:
ul.sharebox {
margin:0px;
padding:0px;
list-style:none;
position:relative;
display:block;
}
ul.sharebox li {
float:left;
margin:0 0 0 0px;
padding:0px;
position:absolute;
}
ul.sharebox li a {
margin:0 0 0 -24px;
display:block;
}
ul.sharebox li a:hover {
margin:0 0 0 -8px;
}
ul.sharebox li img {
border:none;
}
4. Then go to: </head> and before it paste:
<script type='text/javascript'>
(function($){
$.fn.sharebox = function(){
var element = this;
var i = 10;
var j = 0;
$(element).find("li").each(function(){
$(this).css("z-index", i)
if (j>0)
$(this).css("left", j * 24 + 100 + "px");
i = i - 1;
j = j + 1;
});
}
})(jQuery);
$(document).ready(function(){
$("#sharebox").sharebox();
});
</script>
5. Finally find <data:post.body/> and right after it paste the next code:
<b:if cond='data:blog.pageType == "item"'>
<div style='border:1px solid #dfdfdf; padding:0px;width:330px; height:125px'>
<ul class='sharebox' id='sharebox'>
<li><img alt='Share this' src='http://img846.imageshack.us/img846/9038/sharethis.png'/></li>
<li>
<!-- Facebook -->
<a expr:href='"http://www.facebook.com/share.php?u=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank'><img alt='Share On Facebook' border='0' height='' src='http://img834.imageshack.us/img834/7703/fbook48.jpg' width=''/></a>
</li>
<li>
<!-- Digg -->
<a expr:href='"http://digg.com/submit?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank'><img alt='Digg This Post' border='0' height='' src='http://img14.imageshack.us/img14/5488/digg48.png' width=''/></a>
</li>
<li>
<!-- Stumbleupon -->
<a expr:href='"http://www.stumbleupon.com/submit?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank'><img alt='Stumble This Post' border='0' height='' src='http://img190.imageshack.us/img190/9008/sumbleupon48.png' width=''/></a>
</li>
<li>
<!-- Twitthis -->
<a expr:href='"http://twitthis.com/twit?url=" + data:post.url' rel='nofollow' target='_blank'><img alt='Tweet This Post' border='0' height='' src='http://img717.imageshack.us/img717/4218/twitter48.jpg' width=''/></a>
</li>
<li>
<!-- Delicious -->
<a expr:href='"http://del.icio.us/post?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank'><img alt='Save Tis Post To Delicious' border='0' height='' src='http://img833.imageshack.us/img833/1797/delicious48.png' width=''/></a>
</li><li>
<!-- Reddit -->
<a expr:href='"http://www.reddit.com/submit?url=" + data:post.url + "&title=" + data:post.title' rel='nofollow' target='_blank'><img alt='Share On Reddit' border='0' height='' src='http://img339.imageshack.us/img339/7020/reddit48.png' width=''/></a>
</li><li>
<!-- Technorati -->
<a expr:href='"http://technorati.com/faves?add=" + data:post.url' rel='nofollow' target='_blank'><img alt='Bookmark On Technorati' border='0' height='' src='http://img51.imageshack.us/img51/9729/technorati48.png' width=''/></a>
</li>
</ul>
<p style='margin-top:45px;'><img alt='help' src='http://img847.imageshack.us/img847/3645/helptext.jpg'/></p></div>
</b:if>
6. Save the template and see the result.
Post a Comment