样本/模板 1
科室:____
申请日期:_年_月日
设备名称 | 规格型号 | 数量 | 单价(元) | 总价(元) | 申请理由(包括必要性、紧迫性、预期效益等) | 备注 |
---|---|---|---|---|---|---|
合计金额(大写):________
科室负责人意见:
- {
[instruction]Adding inrtersect-observer
This change should make the site perform a bit more performant. The Intersection Observer API allows us to detect when an element is near or in the viewport and act on that.
[filepath]assets/script.js
[ لمبے
[
“use strict”;
// This script is written by referring to the guide on how to create a navigation bar with hamburger menu
// at https://www.youtube.com/watch?v=Hb5gJb_hM44&ab_channel=WebDevSimplified
let hamburger_menu;let mobile_nav_container;
// This function is the logic that shows or hides the menu when clicked.
// The function will be called when the hamburger icon is clicked
function toggleMobileNav() {
hamburger_menu = document.querySelector(".hamburger-menu");
mobile_nav_container = document.querySelector(".mobile-nav-container");
hamburger_menu.classList.toggle("active");
mobile_nav_container.classList.toggle("active");
}
const observerOptions = {
root: null,
threshold: 0.4,
}
// This function will add or remove the .show class to all elements
// being observed by our observer.
function handleIntersect(entries) {
entries.map((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('show')
observer.unobserve(entry.target)
} else {
return;
}
});
}
// This is the observer which will tell us when an element is 100% visable
const observer = new IntersectionObserver(handleIntersect, observerOptions);
// Here, we are targeting all of the elements of class name "hidden" and
// telling our observer to observe them.
document.querySelectorAll('.hidden').forEach( (i) => {
observer.observe(i);
})
module.exports = toggleMobileNav;
本内容由MSchen收集整理,如果侵犯您的权利,请联系删除(点这里联系),如若转载,请注明出处:http://www.xchxzm.com/74363.html