/* jQuery */
$('body').append('<div id="hw-page-progress"></div>');
$(window).scroll(function(){
var _percent = 0;
if($(document).scrollTop()==0) _percent=0;
$('#hw-page-progress').css('width', (($(document).scrollTop()/$(document).height())*100)+_percent+'%' );
});
/* CSS */
#hw-page-progress{
z-index: 999999;
.transition(width 0.1s linear);
margin: 0;
padding: 0;
background: @pink;
position: fixed;
top: 0px;
left: 0px;
height: 3px;
border: none;
overflow: hidden;
width: 0%;
max-width: 100%;
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.