How To Make Gadget Sticky/Float In Blogger

Make-a-gadget-sticky-in-blogger-101helper

Making a gadget sticky or floating means to make it fixed in a position when page is scrolled down and it is possible with javascript. Gadgets are made sticky to provide visitors a good user experience such as a menu which floats with user so now he doesn't need to scroll up again and again to navigate through your blog. Similarly more gadgets are also made sticky such as ads or email subscription widget to get more clicks on ads and to get more subscribers respectively. You can see a live demo of making a gadget sticky on right side of this page(Recommended Articles). I have made it sticky to help visitors reach all of my content. Similarly you can also do it by following this post. So if you want to make any of your widget sticky then follow below steps.

 Don't Miss: 
How To Make A Gadget Sticky Or Float In Blogger:

Step 1: Go to blogger dashboard and navigate to layout.

Step 2: Add a gadget or edit an existing gadget which you want to make sticky.

Step 3: Copy its ID as shown in below image:

how-to-get-id-of-a-gadget-in-blogger


Step 4: Go to template and search for </body> by using Ctrl+F.

Step 5: Copy below code and paste it just above </body>.
<style>.sticker {background:#F5F5F5;position:fixed; top:0px; z-index:99;}</style>
<script>
//<![CDATA[
bs_makeSticky("HTML6"); 
function bs_makeSticky(elem) {
    var sticky = document.getElementById(elem);
    var scrollee = document.createElement("div");
    sticky.parentNode.insertBefore(scrollee, sticky);
    var width = sticky.offsetWidth;
    var iniClass = sticky.className + ' sticky';
    window.addEventListener('scroll', sticker, false);
    function sticker() {
        var rect = scrollee.getBoundingClientRect();
        if (rect.top < 0) {
            sticky.className = iniClass + ' sticker';
            sticky.style.width = width + "px";
        } else {
            sticky.className = iniClass;
        }
    }
}
//]]>
</script>

how-to-make-gadgets-sticky-float-in-blogger

Step 6: Replace HTML6 with your gadget's ID which you found in step 3.

Step 7: Click on save template and you are done. 

Customization:

(1). To change background color or your floating widget replace #F5F5F5 with desired color code.

You Might Also Like: How To Get Code Of A Color, Color Code Generator.

(2). To Change the height of your floating widget(height from top) make changes in top:0px;

I hope you like this post and it was helpful to you. Follow and subscribe to our newsletter or stay in touch with us via social networks to get latest updates about blogger tricks. Thanks for visiting 101helper.blogspot.com. Share this post with others and help me spread my blog.

Search Tags: Sticky gadget blogger, jquery tricks blogger, make a div float, javascript tricks blogger, 101helper blogging tricks, make a widget floating or sticky in blogger.

Related Posts:

  • How To Get Your Blog To The Top Of Google Search ResultsAn issue about seo and bringing blog or site to search result's front page is common with every blogger and webmaster. Despite of applying all the seo tips, meta codes and new seo tricks still there is no improvement? so what… Read More
  • How To Write A Powerful Blog PostYou already know that blogs and sites are popular and you should have one. But do you have any idea what make a blog and a blog post great?I am sure you have heard about having a great, meaningful and educational content or a… Read More
  • How To Create Anchor Links In BloggerHave you ever heared about anchor links? Maybe you are not aware of it as only a few of bloggers use this great thing to make their posts impressive and easier to read. Anchor links are the links which takes you to a specific… Read More
  • How To Add Javascript, HTML And CSS Code Reader In BloggerCode reader is a program that reads html/css/java or any other codes. An example of it is the Html/javascript option which you can see at the time of adding a gadget in your blog. That program reads your java/html and css cod… Read More
  • How To Get DMCA Protection For Your Blogger BlogNow a days a problem that every unique content sharer is facing is content stealing. whenever a unique article is shared and it becomes popular then not only those visits that article who gets idea/help from that post but als… Read More