So what I have is a bigger image wrapped inside a smaller div. So i have scrollbar to see the hidden image parts. But what I want is the image to pan through mouse drag rather than the scroll bars , basically I want Panning to implement on my image.
I have used Panzoom JS but its other functionalities are ruining my code. So is there any javascript hack that I can use to Pan image
body,html
{
width: 100%;
height: 100%;
}
.mainContent
{
width: 400px;
height: 400px;
overflow: scroll;
display: flex;
justify-content: center;
align-items: center;
}
<div class="mainContent">
<img src="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_960_720.jpg">
</div>