Update 1.js

This commit is contained in:
FURK4NGG
2024-11-27 00:39:23 +03:00
committed by GitHub
parent 59199f233b
commit f04ef7f32d
+4 -4
View File
@@ -3,18 +3,17 @@ const boxes = document.querySelectorAll('.services_id');
// Görünürlük kontrol fonksiyonu
function checkVisibility() {
const triggerTop = window.innerHeight * 0.8; // Ekranın altına daha yakın bir tetik noktası
const triggerBottom = window.innerHeight * 0.8; // Ekranın %80'i tetik noktası
boxes.forEach((box) => {
const boxTop = box.getBoundingClientRect().top;
const boxBottom = box.getBoundingClientRect().bottom;
// Eğer kutunun üst kenarı tetikleme noktasını geçerse görünür yap
if (boxTop < triggerBottom) {
// Kutucuk ekranın alt kısmında ise görünür yap
box.classList.add('visible');
box.classList.remove('hidden');
} else {
// Kutucuk ekranın dışında ise gizle
// Aksi halde kutuyu gizle
box.classList.remove('visible');
box.classList.add('hidden');
}
@@ -26,6 +25,7 @@ window.addEventListener('scroll', checkVisibility);
window.addEventListener('load', checkVisibility);
/*IMAGE CHANGER*/
let currentIndex = 0;
const images = document.querySelectorAll('#photo img');