-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tssstjs.js
66 lines (56 loc) · 1.95 KB
/
Tssstjs.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
$(window).on('scroll', function() {
if ($(this).scrollTop() > 100) { // Adjust the scroll position as needed
$('#fixedHeader').addClass('visible');
} else {
$('#fixedHeader').removeClass('visible');
}
});
$(document).ready(function(){
var slick = $('.slick-carousel');
// Initialize Slick carousel
slick.slick({
centerMode: true,
centerPadding: '60px',
slidesToShow: 3,
infinite: true, // Enable infinite looping
autoplay: true, // Enable autoplay
autoplaySpeed: 5000, // Autoplay speed in milliseconds
responsive: [
{
breakpoint: 768,
settings: {
arrows: true,
centerMode: true,
centerPadding: '40px',
slidesToShow: 2
}
},
{
breakpoint: 480,
settings: {
arrows: true,
centerMode: true,
centerPadding: '40px',
slidesToShow: 1
}
}
]
});
// Automatic movement to center every 3 seconds
setInterval(function() {
var centerSlideIndex = slick.slick('slickCurrentSlide');
var totalSlides = slick.slick('getSlick').slideCount;
// Move to the next slide in sequence
var nextIndex = (centerSlideIndex + 1) % totalSlides;
slick.slick('slickGoTo', nextIndex);
}, 3000); // Adjust the interval as needed (in milliseconds)
// Click event to center slide
$(document).on('click', '.slick-slide', function() {
var index = $(this).data('slick-index');
slick.slick('slickGoTo', index);
});
});
// function openRegistrationForm() {
// // Logic to open the registration form
// alert('Registration form will open here.');
// }