I've found a function for my website that animate my bar skills.
That work but in Chrome Inspector, I see that width don't stop to be changed (it's not visible on screen, just in inspector).
This is my JS code :
function launchSkills(){
$(document).ready(function() {
$('.bar span').hide();
// HTML5
$('#bar-one').animate({
width: '95%'
}, 1000);
// CSS3
$('#bar-two').animate({
width: '85%'
}, 1000);
// Javascript
$('#bar-three').animate({
width: '30%'
}, 1000);
// jQuery
$('#bar-four').animate({
width: '40%'
}, 1000);
// PHP
$('#bar-five').animate({
width: '40%'
}, 1000);
setTimeout(function() {
$('.bar span').fadeIn('slow');
}, 1000);
});
}
$(window).scroll(function(){
$('#skills').each(function(){
if(isVisible($(this), $(window))){
launchSkills();
};
});
});
This is my HTML code :
<div class="container-fluid">
<div class="row">
<h4 class="text-center">Langages</h4>
<noscript style="position: absolute;top: 75px;left: 180px;">
Impossible d'afficher l'animation sans JavaScript.
</noscript>
</div>
<div class="row">
<div class="col-md-2">
<p>HTML5</p>
</div>
<div class="col-md-10">
<p>
<span id="bar-one" class="bar" style="width: 94.9995%; overflow: hidden;"></span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-2">
<p>CSS3</p>
</div>
<div class="col-md-10">
<p>
<span id="bar-two" class="bar" style="width: 85.0002%; overflow: hidden;"></span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-2">
<p>Javascript</p>
</div>
<div class="col-md-10">
<p>
<span id="bar-three" class="bar" style="width: 30.0009%; overflow: hidden;"></span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-2">
<p>jQuery</p>
</div>
<div class="col-md-10">
<p>
<span id="bar-four" class="bar" style="width: 39.9988%; overflow: hidden;"></span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-2">
<p>PHP</p>
</div>
<div class="col-md-10">
<p>
<span id="bar-five" class="bar" style="width: 39.9997%; overflow: hidden;"></span>
</p>
</div>
</div>
</div>
Can you see the problem ? I tried to add .stop() after "1000)" but the animation didn't work...