diff --git a/jquery.readingbar.min.js b/jquery.readingbar.min.js new file mode 100644 index 0000000..c83f1c3 --- /dev/null +++ b/jquery.readingbar.min.js @@ -0,0 +1 @@ +(function(e){e.fn.viewportOffset=function(){var t=e(this).offset();return{top:t.top+e(window).scrollTop()}};e.fn.readingbar=function(t){if(e(".read-bar").length){}else{e('
').appendTo("body");e(".read-bar").css({position:"fixed",bottom:"0",left:"0",width:"0",maxWidth:"100%"});var n={backgroundColor:"#E76E66",height:"5px"};settings=e.extend({},n,t);e(".read-bar").css({height:settings.height,backgroundColor:settings.backgroundColor})}_=e(this);var r=_.outerHeight();var i=_.offset().top*1.8;var s=0;e(document).on("scroll",function(){s=(_.viewportOffset().top-i)/r*100;e(".read-bar").css("width",s+"%")})}})(jQuery)