38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
// ... existing code ...
|
|
document.getElementById('careers').addEventListener('click', function(e) {
|
|
e.preventDefault(); // 阻止默认锚点跳转
|
|
alert('你已经在这里啦(^• ω •^)ノ');
|
|
|
|
// 如果确实需要跳转可以添加:
|
|
// window.location.href = "/";
|
|
});
|
|
// 导航栏滚动效果
|
|
window.addEventListener('scroll', () => {
|
|
const nav = document.querySelector('nav');
|
|
window.scrollY > 100 ?
|
|
nav.classList.add('nav-scrolled') :
|
|
nav.classList.remove('nav-scrolled');
|
|
});
|
|
|
|
// 加载状态控制
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
document.documentElement.classList.remove('slideshow-loading');
|
|
});
|
|
|
|
window.addEventListener('load', () => {
|
|
const loader = document.querySelector('.loading-spinner');
|
|
if (loader) loader.style.display = 'none';
|
|
});
|
|
|
|
// 防止页面加载时的布局闪烁
|
|
document.documentElement.style.visibility = 'hidden';
|
|
window.addEventListener('load', () => {
|
|
document.documentElement.style.visibility = 'visible';
|
|
});
|
|
// ... existing code ...
|
|
|
|
window.addEventListener('scroll', () => {
|
|
const body = document.querySelector('body');
|
|
body.classList.toggle('scrolling', window.scrollY > 50);
|
|
});
|