Update 1.js
This commit is contained in:
+4
-4
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user