Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="progress">
- <div class="progress-bar progress-bar-striped" role="progressbar" style="width: 0" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
- </div>
- $(".progress-bar").each(function () {
- $(this).animate( {width: $(this).attr('aria-valuenow') + '%' }, 2000 );
- });
- $(window).scroll( function(){
- $(".progress-bar").each(function () {
- var bottom_of_object = $(this).position().top + $(this).outerHeight();
- var bottom_of_window = $(window).scrollTop() + $(window).height();
- if( bottom_of_window > bottom_of_object ){
- $(this).animate( {width: $(this).attr('aria-valuenow') + '%' }, 2000 );
- }
- });
- });
Add Comment
Please, Sign In to add comment