Efeito Neom Dinâmico

Código CSS

				
					/* container */
.container-scroll {
  height: 300px;
  overflow: hidden;
  }
  
  
  /* Imagem em scroll */
  .img-scroll img{
  object-fit: contain;
  object-position: 0px 0px;
  transition: object-position 6s ease;
  }
				
			

Código Javascript

				
					<script>
var containerScroll = document.querySelectorAll('.img-scroll img');
for(i=0; i<containerScroll.length;i++){
containerScroll[i].addEventListener('mouseenter', function(hover){
var imgHeight = this.scrollHeight;
var scrollheight = imgHeight - 300;
hover.target.style.objectPosition = `0px -${scrollheight}px`;

});

containerScroll[i].addEventListener('mouseleave', function(hover){
hover.target.style.objectPosition = '0px 0px';


});
}

</script>