Raffales-LMS/public/js/custom.js
2024-04-16 15:43:24 +05:45

104 lines
2.5 KiB
JavaScript
Vendored

function checkScroll() {
var startY = $('.navbar').height() * 2; //The point where the navbar changes in px
if ($(window).scrollTop() > startY) {
$('.navbar').addClass("scrolled");
} else {
$('.navbar').removeClass("scrolled");
}
}
if ($('.navbar').length > 0) {
$(window).on("scroll load resize", function () {
checkScroll();
});
}
$(".js-select-course").select2({
placeholder: "Please Select Interested Course"
});
$(".js-select-multiple").select2({
placeholder: "Please Select Multiple Course"
});
// When the user scrolls down 80px from the top of the document, resize the navbar's padding and the logo's font size
window.onscroll = function () { scrollFunction() };
function scrollFunction() {
if (document.body.scrollTop > 10 || document.documentElement.scrollTop > 40) {
document.getElementById("navbar").style.padding = "10px 0px";
} else {
document.getElementById("navbar").style.padding = "10px 0px";
}
if (document.body.scrollTop > 40 || document.documentElement.scrollTop > 40) {
document.getElementById("navbar").style.background = "#fff";
} else {
document.getElementById("navbar").style.background = "transparent";
}
if (document.body.scrollTop > 40 || document.documentElement.scrollTop > 40) {
document.getElementById("navbar").style.boxShadow = "rgba(0, 0, 0, 0) 0px 10px 20px, rgba(0, 0, 0, 0.166) 0px 6px 6px";
} else {
document.getElementById("navbar").style.boxShadow = "none";
}
}
/** why us */
$(document).ready(function () {
var silder = $("#why-us");
silder.owlCarousel({
autoplay: true,
autoplayTimeout: 2000,
autoplayHoverPause: false,
stagePadding: 20,
center: false,
nav: true,
margin: 10,
dots: true,
loop: true,
responsive: {
0: { items: 1 },
480: { items: 2 },
575: { items: 2 },
768: { items: 2 },
991: { items: 2 },
1200: { items: 2 }
}
});
});
jQuery(document).ready(function ($) {
"use strict";
// TESTIMONIALS CAROUSEL HOOK
$('#customers-testimonials').owlCarousel({
loop: true,
center: true,
items: 3,
margin: 0,
autoplay: true,
dots: true,
autoplayTimeout: 2000,
smartSpeed: 450,
responsive: {
0: {
items: 1
},
768: {
items: 2
},
1170: {
items: 2
}
}
});
});