relocate images to fit image box.
html:
...
<div class="container">
<div class="box">
<img src="images/height-image.jpg" alt="">
</div>
<div class="box">
<img src="images/width-image.jpg" alt="">
</div>
</div>
...
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/relocator.min.js"></script>
<script>
jQuery(document).ready(function($){
$('.box img').relocate();
});
</script>
$(imageSelector).relocate($imageBoxSelector);
imageBoxSelector
Specify picture reference container, default picture parent reference.
example:
<div class="box">
<div class="img-wrapper">
<a href=""><img src="" alt=""></a>
</div>
<p>The image title</p>
</div>
...
<script>
jQuery(document).ready(function($){
$('.box img').relocate('.img-wrapper'); // Actually:$(img).closet(''.img-wrapper'')
});
</script>
MIT