forked from SyedImtiyaz-1/GetTechProjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
74 lines (61 loc) · 2.04 KB
/
main.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
$(document).ready(function(){
$('.fa-bars').click(function(){
$(this).toggleClass('fa-times');
$('.navbar').toggleClass('nav-toggle');
});
$(window).on('load scroll',function(){
$('.fa-bars').removeClass('fa-times');
$('.navbar').removeClass('nav-toggle');
if($(window).scrollTop()>35)
{
$('.header').css({'background':'#002e5f','box-shadow':'0 .2rem .5rem rgba(0,0,0,.4)'});
$('.login').css({'background':'#227EBB','box-shadow':'none'});
}
else
{
$('.header').css({'background':'none','box-shadow':'none'});
$(".login").css({ background: "#002e5f" });
}
});
(function ($) {
"use strict";
// $(".clients-carousel").owlCarousel({
// autoplay: true,
// dots: true,
// loop: true,
// responsive: { 0: {items: 2}, 768: {items: 4}, 900: {items: 6} }
// });
// $(".testimonials-carousel").owlCarousel({
// autoplay: true,
// dots: true,
// loop: true,
// responsive: { 0: {items: 1}, 576: {items: 2}, 768: {items: 3}, 992: {items: 4} }
// });
})(jQuery);
})
$(document).ready(function() {
// Function to start counting for a single counter
function startCounter(counterElement, target) {
let count = 0;
const speed = Math.ceil(target / 200); // Adjust the speed as needed
const updateCounter = () => {
if (count < target) {
count += speed;
$(counterElement).text(count + "+");
setTimeout(updateCounter, 10);
} else {
$(counterElement).text(target + "+"); // Ensure the final value is accurate
}
};
updateCounter();
}
// Function to initialize all counters
function initCounters() {
$(".counter").each(function() {
const target = parseInt($(this).data("target"));
startCounter(this, target);
});
}
// Call the initCounters function when the document is ready
initCounters();
});