Like Box Right Side
by Bagus Ahmad Setiawan
HTML
<div id="content">
<div id="likebox">
</div>
</div>
CSS
body {
height: 800px;
font-family:'Arial', Helvetica, Sans-Serif;
color: white;
font-weight: bold;
border:1px solid;
color:black;
}
#content {
width:600px;
border:1px solid;
height:600px
}
#likebox {
width:200px;
border:1px solid;
height:600px;
}
JavaScript
// JQuery StickyBar Plugin By Taufik Nurrohman
// URL's: https://plus.google.com/108949996304093815163/about
// Usage: $('div').stickyBar();
;(function($){$.fn.stickyBar=function(o){o=$.extend({until:"",top:0,bottom:0,animated:false,speed:400,easing:null,fixedClass:'isFixed',stoppedClass:'isStopped',onFixed:function(){},onStatic:function(){},onStopped:function(){}},o);return this.each(function(){var b=$(this),o_top=b.offset().top,o_m_top=b.css('margin-top'),o_m_bottom=b.css('margin-bottom'),o_height=b.outerHeight(),o_pos=b.css('position'),o_limit=(o.until!=="")?$(o.until).offset().top-o_height-o.top:$(document).height();if(!o.animated){$('<div />',{'class':'space-holder','style':'display:none;height:'+o_height+'px;margin-top:'+o_m_top+';margin-bottom:'+o_m_bottom}).insertBefore(b)}else{if(o_pos=='static'){b.css('position','relative')}}$(window).on("scroll",function(){var a=$(this).scrollTop();if(a>=o_top-o.top){if(a<=o_limit-o.bottom){o.onFixed.call(b);if(!o.animated){b.css({'position':'fixed','top':o.top,'left':b.offset().left,'width':b.width()+'px','margin-top':0}).removeClass(o.stoppedClass).addClass(o.fixedClass).prev().show()}else{b.stop().animate({top:a-o_top+o.top},o.speed,o.easing,function(){$(this).css('top',a-o_top+o.top)}).removeClass(o.stoppedClass).addClass(o.fixedClass)}}else{o.onStopped.call(b);b.css({'position':'relative','top':o_limit-o_top-o.bottom,'left':0,'margin-top':o_m_top,'margin-bottom':o_m_bottom+o.bottom}).removeClass(o.fixedClass).addClass(o.stoppedClass).prev().hide()}}else{o.onStatic.call(b);if(!o.animated){b.css({'position':o_pos,'top':0,'left':0,'margin-top':o_m_top,'margin-bottom':o_m_bottom}).removeClass(o.fixedClass+' '+o.stoppedClass).prev().hide()}else{b.stop().animate({top:0},o.speed,o.easing,function(){$(this).css('top',0)}).removeClass(o.fixedClass+' '+o.stoppedClass)}}})})}})(jQuery);