| 2 comments ]

Hello guys. This is tutorials adapted from HERE
This will give you Mashable-like floating social bookmarks. I found it so interesting. So, im sharing with you guys here.In this tutorial I will tell you the method that can be used to implement this widget to Blogger by using the features of jQuery.

http://4.bp.blogspot.com/_dzq0x75P67s/TE7FaSv0oYI/AAAAAAAAB9g/92B7YE3zg4Q/s200/floating+share+widget.PNG 


1. Go to Design > Edit HTML tab and check “Expand Widget Templates”. Find <data:post.body/> and before this snippet add:
<b:if cond='data:blog.pageType == "item"'>
<div id='sharebox'>
<div class='wdt'> Retweet Button </div>
<div class='wdt'> Facebook Share </div>
<div class='wdt'> StumbleUpon </div>
<div class='wdt'> Digg </div>
<div class='wdt'> The bookmarking button you want to add next </div>
</div>
</b:if>

Add your share buttons scripts between “<div class=’wdt’>add the share button code</div>”. You can get script codes from the bookmarking sites that you may like to add or you can also my blog posts labeled as Button Counter. Here is an example to how to add the codes:
<div class='wdt'><script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script></div>

2. Add the latest jQuery library immediately after ]]>< /b:skin>.
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'></script>
If you have previously added it, then you need not to add another one, just check whether it’s the latest or not and then replace it.

3. Next is to add the JavaScript which will make the share box to float like Mashable that I have find out from CSS Tricks and modified a little by adding “document ready” function. Find </head> and before it add:
<script type='text/javascript'>
$(document).ready(function() {

var $sidebar = $("#sharebox"),
$window = $(window),
offset = $sidebar.offset(),
topPadding = 15;

$window.scroll(function() {
if ($window.scrollTop() > offset.top) {
$sidebar.stop().animate({
marginTop: $window.scrollTop() - offset.top + topPadding
});
} else {
$sidebar.stop().animate({
marginTop: 0
});
}
});

});
</script>

4. Now is the CSS part. Add the below styling properties above ]]>< /b:skin>:
#sharebox {
float: left;
margin-left: -80px;
position: absolute;
background: #fff;
}
#sharebox .wdt {
float: left;
clear: left;
padding: 5px;
}
If you want the share box widget to float further left to your post body, then increase the value marked in bold and if you want it to float closer then decrease it.

5. Save your template.

2 comments

Anonymous said... @ April 9, 2013 at 7:30 AM

A low аωaгeness of thе lіnκѕ busіnesѕ уοu аre advеrtising.

Τhоse buѕineѕs are thе objectiveѕ that
уou woulԁ liκe tо maκe moneу 24/7.
Howеvеr, ρoωeг also сomes ωіth responsіbilitу.
I ωаsn't sure what reaction to expect but the customers concern is much more likely to be ones that are made on a bookkeeping spreadsheet.

Here is my blog sample internet marketing plan

SEO Link Building List said... @ May 27, 2015 at 5:26 PM

Thanks for share this POST...

Try this 3 list of Social Bookmarking Sites :

1. Top High PR Social Bookmarking Sites List
2. Social Bookmarking Sites List
3. Social Bookmarking List

Thank You...

Post a Comment

Related Posts with Thumbnails