$(window).scroll(function onScroll() {
if ($(this).scrollTop() > 777) {
$('.div_clone').clone().appendTo('.container2');
$(this).off('scroll', onScroll);
}
});
// или
window.addEventListener('scroll', function onScroll() {
if (this.scrollY > 777) {
document.querySelector('.container2').append(
document.querySelector('.div_clone').cloneNode(true)
);
this.removeEventListener('scroll', onScroll);
}
});
$('.item').matchHeight() в $(function() {}) тоже не нужно. Это onLoad, в него должен быть обёрнут весь этот код.function resize() {
if ( $(window).width() < 992 ) {
$('.item').matchHeight();
}
}
$(window).resize(resize);
resize();