fix JavaScript error

This commit is contained in:
vincentinttsh 2021-01-23 23:10:27 +08:00
parent b4d2f5c943
commit a7daa7cda4
2 changed files with 82 additions and 79 deletions

View File

@ -49,6 +49,20 @@ var mainWindow = {
main.departments.sort() main.departments.sort()
main.selectDepartment = main.departments[15] main.selectDepartment = main.departments[15]
}) })
.then(function () {
// Collapse Navbar
var navbarCollapse = function () {
if ($("#mainNav").offset().top > 100) {
$("#mainNav").addClass("navbar-shrink");
} else {
$("#mainNav").removeClass("navbar-shrink");
}
};
// Collapse now if page is not at top
navbarCollapse();
// Collapse the navbar when page is scrolled
$(window).scroll(navbarCollapse);
})
}, },
methods: { methods: {
'login': function () { 'login': function () {

View File

@ -41,18 +41,7 @@
offset: 80 offset: 80
}); });
// Collapse Navbar
var navbarCollapse = function() {
if ($("#mainNav").offset().top > 100) {
$("#mainNav").addClass("navbar-shrink");
} else {
$("#mainNav").removeClass("navbar-shrink");
}
};
// Collapse now if page is not at top
navbarCollapse();
// Collapse the navbar when page is scrolled
$(window).scroll(navbarCollapse);
// Floating label headings for the contact form // Floating label headings for the contact form
$(function() { $(function() {