Enhanced Social Sharing Widget Slides After A Certain Distance From Top

and today we are here with another tweak to the social sharing widget that features Facebook sharing button, Google+1 button and Twitter Tweet feature. One of our commentators requested the post, so here it is dude

When we restrict the social sharing widget to slide (scroll) over after a set distance, it provides an overall clean look to the blog.

Before moving on, you may like to read:

Enhanced Social Sharing Widget

DEMO VIDEO




How To Add Sliding Social Media Sharing Widget To Blogs/Websites?


Step 1: Add a HTML/JavaScript widget to your Blogger blog


In case you're on Blogger you need to add a HTML/JavaScript gadget on your blog. In case you wish to add the widget on your website, you can independently add the HTML and JavaScript in their respective files on your site.

Step 2: Add The Following Code

Now once you have opened up the HTML/JavaScript gadget, simply paste the following code in it and hit save.


<script>

window.onload = function() {

  function getScrollTop() {
    if (typeof window.pageYOffset !== 'undefined' ) {
      // Most browsers
      return window.pageYOffset;
    }

    var d = document.documentElement;
    if (d.clientHeight) {
      // IE in standards mode
      return d.scrollTop;
    }

    // IE in quirks mode
    return document.body.scrollTop;
  }

  window.onscroll = function() {
    var box = document.getElementById('BeH-Social-Fixed'),
        scroll = getScrollTop();

    if (scroll <= 995) {
      box.style.top = "1005px";
    }
    else {
      box.style.top = (scroll + 10) + "px";
    }
  };

}


 </script>


<style>

#BeH-Social-Fixed {

  position: absolute;
 
}

/*-------BeH Floating Sharing Widget------------*/
#floatdiv {
 
bottom:15%;
margin-left:-850px;
z-index:10;
float:left;
padding-bottom:2px;
}
#BeHsidebar {
        background:#fff;
        border-top:1px solid #ddd;
        border-left:1px solid #ddd;
        border-bottom:1px solid #ddd;
        border-radius:5px;
       -moz-border-radius:5px;
       -webkit-border-radius:5px;
        padding-left:5px;
        width:60px;
        margin:0 0 0 5px;
}
.fb_share_count_top {width:52px !important;}
.fb_share_count_top, .fb_share_count_inner {-moz-border-radius:3px;-webkit-border-radius:3px;}
.FBConnectButton_Small, .FBConnectButton_RTL_Small {width:52px !important; -moz-border-radius:3px;/*bs-fsmsb*/-webkit-border-radius:3px;}
.FBConnectButton_Small .FBConnectButton_Text {padding:2px 2px 3px !important;-moz-border-radius:3px;-webkit-border-radius:3px;font-size:8px;}
</style>

<div id="AdSense-Fixed">
<div id="floatdiv">
<div id="BeHsidebar">
    <table cellpadding="1px" cellspacing="0">

    <tr>
    <td style="padding:5px 0px 0px 0;">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="Bloggingehow">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    </td>
    </tr>
    <tr>
    <td style="padding:5px 0 2px 0;">
    <a name="fb_share" type="box_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
    </td>
    </tr>
    <tr>
    <td style=" padding:5px 0px 0px 0px;">
<script src='http://apis.google.com/js/plusone.js' type='text/javascript'> {lang: &#39;en-US&#39;} </script>
<g:plusone size="Tall" expr:href="data:post.url">
    </g:plusone></td>
    </tr>
    <tr>
    <td>
<p style=" line-height:0px; font-size:7px; font-weight:bold; text-align:center;"><a style="color:#D3D3D3;" href="http://www.bloggingehow.com">Widgets</a></p>
    </td>
    </tr>
    </table>
</div>
</div></div>

Customization


In case you wish to customize the placement of the social sharing widget, you can adjust the values highlighted in the code. 

To Adjust the static height from top:  (First value)


box.style.top = "1005px";

To Adjust the padding/distance from top 'while scrolling' : (Second Value)

  if (scroll <= 995) {

 Third value needs to be the distance between the previous two values for smooth scrolling. So in case you choose the first value to be 100 and second value to be 80, that the third value must be 20 (100-80 = 20 )

Third Value :

box.style.top = (scroll + 10) + "px";

Thats all! Simply adjust these three values and you would get the desired results for the scrolling social sharing widget.

You may like to read:

Google Analytics: 6 Crucial Metrics To Monitor Your Blog's Growth
Google Analytics: How to Add Custom Widgets To Dashboard  

Respect Copyrights!


The original widget was designed by our fellow blogger Muhammad from MBT. We enhanced the widget by adding the advanced scrolling feature. kindly respect the copyright. It takes hours to modify a certain widget that we bring in to you guys.

Stay safe nation smile

You may like to read:

COMMENTS

.
Name

AdSense affiliate marketing Announcement AskHassam Blogger Blogging Tips Blogosphere News Bluehost Building Traffic BuySellAds Contest Customizations Disqus Tutorials Domain Hosting Drop Down Menus eBook Email Marketing Facebook Tutorials Feedburner Freelancing Giveaway Google Google Analytics Google Gmail Google Plus Tricks Guest Post HowTo Interview Making Money Online Monetization Motivation PayPal Pinterest Plugins review SEO Slideshare Social Media Top Lists Twitter Wordpress YouTube
false
ltr
item
BloggingeHow | Making Blogging Simpler: Enhanced Social Sharing Widget Slides After A Certain Distance From Top
Enhanced Social Sharing Widget Slides After A Certain Distance From Top
http://1.bp.blogspot.com/-n5ogP9CCJaI/T-34u3ncYRI/AAAAAAAAEnU/8-zgb4RiEAg/s1600/Untitled.png
http://1.bp.blogspot.com/-n5ogP9CCJaI/T-34u3ncYRI/AAAAAAAAEnU/8-zgb4RiEAg/s72-c/Untitled.png
BloggingeHow | Making Blogging Simpler
http://www.bloggingehow.com/2012/06/Social-sharing-widget-that-slides-after-distance-from-top.html
http://www.bloggingehow.com/
http://www.bloggingehow.com/
http://www.bloggingehow.com/2012/06/Social-sharing-widget-that-slides-after-distance-from-top.html
true
5839591175544873606
UTF-8
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy
Resources

Tools of the Trade