-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
35 lines (27 loc) · 885 Bytes
/
script.js
File metadata and controls
35 lines (27 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// var w = window.innerWidth;
// console.log(w);
// if(w<782) {
// $('.progress-bar').animate({
// opacity: 1
// }, {
// progress: function (animation, progress, msRemaining) {
// $('.progress-bar').html(100 * progress + "%");
// }
// })
// }
$(document).ready(function(){
var eventFired = false,
objectPositionTop = ($('#skill').offset().top - 400);
$(window).on('scroll', function() {
var currentPosition = $(document).scrollTop();
if (currentPosition > objectPositionTop && eventFired === false) {
eventFired = true;
$('.progress-bar').each(function() {
$(this).animate({
width: $(this).data('percent') + '%'
}, 2000);
});
}
});
})