Skip to content

Instantly share code, notes, and snippets.

@cosenary
Created January 11, 2014 14:02
Show Gist options
  • Save cosenary/8371257 to your computer and use it in GitHub Desktop.
Save cosenary/8371257 to your computer and use it in GitHub Desktop.
Page progress indicator. http://jsbin.com/OXuhUcAx/1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page progress example</title>
<style>
body {
background-color: #fff;
}
#page_progress {
height: 2px;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
#page_progress #inner_loader {
background-color: #de3928;
display: block;
height: 2px;
width: 0;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(document).ready(function() {
var scrollPercent;
$(document).scroll(function(){
scrollPercent = (document.documentElement.scrollTop + document.body.scrollTop) / (document.documentElement.scrollHeight - document.documentElement.clientHeight) * 100 + "%";
$("#inner_loader").css({ "width" : scrollPercent });
});
});
</script>
</head>
<body>
<div id="page_progress">
<span id="inner_loader"></span>
</div>
<p>
Gingerbread gummi bears pastry croissant. Gummies brownie dessert. Gingerbread pastry cookie. Cookie chocolate cake tootsie roll marshmallow cheesecake cookie bonbon topping cheesecake. Candy chocolate gingerbread. Cookie icing apple pie chocolate bar pastry gummi bears unerdwear.com carrot cake. Jelly applicake chocolate cake gingerbread sesame snaps carrot cake sugar plum. Icing biscuit gummi bears chocolate. Ice cream tiramisu topping croissant sweet roll applicake dessert. Dragée gingerbread chupa chups pie cake carrot cake tiramisu. Sweet roll wafer chocolate bar sweet roll marzipan applicake sesame snaps. Marzipan sesame snaps tiramisu halvah. Tootsie roll pie danish unerdwear.com soufflé donut muffin icing chupa chups. Muffin applicake danish liquorice jelly-o.
Donut candy canes liquorice cotton candy dessert liquorice gingerbread jelly beans. Applicake candy canes fruitcake cheesecake. Sesame snaps ice cream sweet. Chocolate bar caramels jelly beans powder donut tart donut jelly. Sweet roll caramels apple pie applicake. Macaroon halvah lemon drops. Chocolate bar fruitcake chocolate bar tiramisu. Gingerbread unerdwear.com cotton candy. Muffin cheesecake soufflé carrot cake pie. Ice cream toffee bear claw chupa chups. Tootsie roll marshmallow dragée soufflé. Tiramisu croissant jelly. Jujubes sweet roll liquorice.
Dragée bonbon macaroon icing tootsie roll chocolate. Apple pie soufflé candy canes applicake tart fruitcake dessert jujubes. Pie powder applicake wafer apple pie. Jujubes lollipop jelly-o caramels. Candy canes pie powder unerdwear.com jelly liquorice chocolate bar. Halvah icing tootsie roll wafer apple pie tiramisu sweet marzipan. Sugar plum marzipan cake cupcake marzipan jelly donut. Danish sweet powder brownie. Liquorice chocolate cake tart fruitcake icing biscuit. Lemon drops gummies danish ice cream. Sweet roll pudding danish ice cream. Carrot cake donut dragée tootsie roll. Topping candy canes bear claw candy liquorice jujubes marshmallow chocolate bar cookie.
Sweet lollipop biscuit marshmallow bonbon sesame snaps lemon drops sesame snaps chocolate cake. Soufflé icing sugar plum cupcake soufflé gingerbread cupcake. Marzipan soufflé wafer cheesecake. Pastry danish cheesecake candy canes dragée gingerbread marzipan soufflé. Chocolate cake chocolate bar sesame snaps cupcake topping brownie. Tiramisu topping candy canes. Biscuit gummies powder brownie bonbon tootsie roll. Caramels chocolate toffee chocolate brownie candy chocolate jelly-o bear claw. Sugar plum icing gummi bears apple pie sweet sesame snaps wafer topping. Cheesecake caramels biscuit bonbon liquorice topping liquorice jelly beans. Oat cake marshmallow pudding cheesecake pie croissant dessert sweet. Croissant marshmallow biscuit donut. Chocolate cake apple pie sweet roll biscuit cupcake bonbon tart unerdwear.com oat cake. Ice cream cotton candy pastry.
Applicake brownie candy canes sweet roll gummi bears applicake jelly-o. Toffee bonbon fruitcake. Wafer donut applicake. Chocolate sweet roll fruitcake. Oat cake dragée chupa chups gummies jelly beans gummies. Brownie macaroon marshmallow sweet. Croissant croissant jujubes. Soufflé pastry bonbon dessert gummi bears chocolate cake dragée macaroon gummies. Jelly pastry sweet roll jelly. Bear claw jelly-o chocolate bar. Caramels apple pie apple pie sweet chocolate cake jujubes tiramisu macaroon. Liquorice danish bonbon pastry cotton candy bear claw cookie oat cake. Lollipop sugar plum applicake cake marzipan caramels cotton candy. Candy danish lemon drops.
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment