As far as blogging is concern, the widgets that floats or stick on a blog or websites have high click through and conversion rate than static objects/widgets. That is why many websites out there make use of floating elements throughout their websites.
Without wasting time lets learn how to get this done on your blogger dashboard.
Visit Blogger Dashboard >> Template >> Edit HTML and search for </body>
Now paste the below code just above/before
</body>
វីធីទី ២
<!-- End sticky widgets -->
<script>
//<![CDATA[
HG_makeSticky("HTML2"); // enter your widget ID here
function HG_makeSticky(elem) {
var HG_sticky = document.getElementById(elem);
var scrollee = document.createElement("div");
HG_sticky.parentNode.insertBefore(scrollee, HG_sticky);
var width = HG_sticky.offsetWidth;
var iniClass = HG_sticky.className + ' HG_sticky';
window.addEventListener('scroll', HG_sticking, false);
function HG_sticking() {
var rect = scrollee.getBoundingClientRect();
if (rect.top < 0) {
HG_sticky.className = iniClass + ' HG_sticking';
HG_sticky.style.width = width + "px";
} else {
HG_sticky.className = iniClass;
}
}
}
//]]>
</script>
<style>
.HG_sticking {background:#ffffff !important; position:fixed !important; top:0; z-index:2; box-shadow:0px 10px 4px -5px rgba(0,0,0,0.3); margin-top: 0; position:relative9 !important;}
</style>
<!-- End sticky widgets -->
How to Customize ==> Just change HTMLID highlighted in the code with your widget ID and save your template.Visit your Blog and see the Magic but incase you have any problem just drop a comment and I would reply you as soon as possible.
EmotionEmotion