مدیاویکی:Common.js: تفاوت میان نسخهها
از ویکی معرفت
More languages
More actions
Nazarzadeh (بحث | مشارکتها) صفحه را خالی کرد برچسب: خالی کردن |
Nazarzadeh (بحث | مشارکتها) بدون خلاصۀ ویرایش برچسب: برگرداندهشده |
||
| خط ۱: | خط ۱: | ||
/* main page fade in */ | |||
const observer = new IntersectionObserver( | |||
(entries) => { | |||
entries.forEach((entry) => { | |||
if (entry.isIntersecting) { | |||
entry.target.classList.add('fadedin') | |||
entry.target.classList.remove('fadein') | |||
} else { | |||
entry.target.classList.remove('fadedin') | |||
entry.target.classList.add('fadein') | |||
} | |||
}) | |||
}, | |||
{ | |||
rootMargin: '0px', | |||
threshold: [0, 0.1, 1], | |||
}, | |||
) | |||
const tags = document.querySelectorAll('div') | |||
tags.forEach((tag) => { | |||
observer.observe(tag) | |||
}) | |||
نسخهٔ ۲۸ نوامبر ۲۰۲۵، ساعت ۱۱:۰۶
/* main page fade in */
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('fadedin')
entry.target.classList.remove('fadein')
} else {
entry.target.classList.remove('fadedin')
entry.target.classList.add('fadein')
}
})
},
{
rootMargin: '0px',
threshold: [0, 0.1, 1],
},
)
const tags = document.querySelectorAll('div')
tags.forEach((tag) => {
observer.observe(tag)
})