javascript - How to fire jQuery in page view? -


i want animation start when portion either selected nav bar or in view on scrolling.
sample code:
html:

    <section id="section-skills" class="section appear clearfix">             <div class="container">                 <div class="row mar-bot40">                     <div class="col-md-offset-3 col-md-6">                         <div class="section-header">                             <h2 class="section-heading animated" data-animation="bounceinup">skills</h2>     </div> </div> </div> </div> <div class="container">                 <div class="row" >                 <div class="col-md-6"> <div class="skillbar clearfix " data-percent="80%">     <div class="skillbar-title" style="background: #333333;"><span>java</span></div>     <div class="skillbar-bar" style="background: #525252;"></div>     <div class="skill-bar-percent">75%</div> </div> <!-- end skill bar -->  <!--rest of code follows in example link provided-->   </section> 

i tried using waypoint in jquery it's not working.

jquery(document).ready(function(){   $('#section-skills').waypoint(function(direction) {       jquery('.skillbar').each(function(){         jquery(this).find('.skillbar-bar').animate({             width:jquery(this).attr('data-percent')         },6000);     }); }); }); 

any solution helpful.

use jquery appear repository start animation when elements in viewport.

here sample code

html:

    <!-- progress bars --> <div class="skills-wrap">     <div class="container">         <!-- blue progress bars -->         <h1 class="text-center">blue progress bars</h1>         <div class="skills progress-bar1">             <ul class="col-md-6 col-sm-12 col-xs-12">                 <li class="progress">                     <div class="progress-bar" data-width="85">                         wordpress 85%                     </div>                 </li>                 <li class="progress">                     <div class="progress-bar" data-width="65">                         graphic design 65%                     </div>                 </li>                 <li class="progress">                     <div class="progress-bar" data-width="90">                         html/css design 90%                     </div>                 </li>                 <li class="progress">                     <div class="progress-bar" data-width="60">                         seo 60%                     </div>                 </li>             </ul>             <ul class="col-md-6 col-sm-12 col-xs-12 wow fadeinright">                 <li class="progress">                     <div class="progress-bar" data-width="75">                         agencying 75%                     </div>                 </li>                 <li class="progress">                     <div class="progress-bar" data-width="95">                         app development 95%                     </div>                 </li>                 <li class="progress">                     <div class="progress-bar" data-width="70">                         consultency 70%                     </div>                 </li>                 <li class="progress">                     <div class="progress-bar" data-width="90">                         theme development 90%                     </div>                 </li>             </ul>         </div>         <!-- /blue progress bars -->     </div> </div> 

the css:

.progress {     height: 35px;     line-height: 35px;     margin-bottom: 45px;     background: #fff;     border-radius: 0;     box-shadow: none;     list-style: none; }  .progress-bar {     font-weight: 600;     line-height: 35px;     padding-left: 20px;     text-align: left; }  .progress-bar1 .progress-bar {     background: #026ea6; } 

script:

jquery(document).ready(function () {  /*----------------------------------------------------*/ /*  animated progress bars /*----------------------------------------------------*/      jquery('.skills li').each(function () {         jquery(this).appear(function() {           jquery(this).animate({opacity:1,left:"0px"},800);           var b = jquery(this).find(".progress-bar").attr("data-width");           jquery(this).find(".progress-bar").animate({             width: b + "%"           }, 1300, "linear");         });      });     }); 

the live demo here @ bootstrap animated progress bar


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -