JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main">
<div id="map"></div>
</div>
CSS
#main
{
width: 400px;
height: 400px;
overflow: hidden;
}
#map
{
width: 640px;
height: 480px;
background-image: url(http://orig00.deviantart.net/ed21/f/2010/236/6/5/rpg_maker_xp_test_map_01_by_peachmario99.png);
}
JavaScript
jQuery('#map').draggable({
containment: "#main"
}
);