A
Size: a a a
A
VL
VL
A
V
VL
let images = document.querySelectorAll('.imgz');
//
let options = {
root: null,
rootMargin: '0px',
threshold: 0.05,
}
//
let callback = function(entries, observer){
entries.forEach(myImgX =>{
console.log(myImgX.intersectionRatio);
if(myImgX.intersectionRatio > 0){
loadImage(myImgX.target);
let mt = myImgX.target;
mt.style.visibility = 'visible';
mt.style.width = 330 +'px';
mt.style.opacity = '1';
}
});
};
//
function loadImage(image){
image.src = image.getAttribute('data');
};
//
let observer = new IntersectionObserver(callback, options);
//
images.forEach(img =>{
observer.observe(img);
})
//
<img src="" data="img/for_emmanuel_tv1.jpg" class="imgz"/>
A
let images = document.querySelectorAll('.imgz');
//
let options = {
root: null,
rootMargin: '0px',
threshold: 0.05,
}
//
let callback = function(entries, observer){
entries.forEach(myImgX =>{
console.log(myImgX.intersectionRatio);
if(myImgX.intersectionRatio > 0){
loadImage(myImgX.target);
let mt = myImgX.target;
mt.style.visibility = 'visible';
mt.style.width = 330 +'px';
mt.style.opacity = '1';
}
});
};
//
function loadImage(image){
image.src = image.getAttribute('data');
};
//
let observer = new IntersectionObserver(callback, options);
//
images.forEach(img =>{
observer.observe(img);
})
//
<img src="" data="img/for_emmanuel_tv1.jpg" class="imgz"/>
VL
A
VL
A
A
М
A
VL
М
A
A
A