[help] how to achieve central magnification of pictures in div?

refer to https://www.jb51.net/article/., modify the code as follows:
but the effect is the magnification effect started on the left
how to achieve the central magnification effect in the img in div?

<script type="text/javascript">
function fangda(){
    var pic=$(".pictures img");
    var wValue=20+pic.width();
    var hValue=20+pic.height();
    pic.animate({width: wValue, height: hValue, left:("-"+(0.5 * pic.width())/2), top:("-"+(0.5 * pic.height())/2)}, 1000);
}
</script>
<body>
<button onclick="fangda()"></button>
<style>
.pictures {
    width: 414px;
    height: 390px;
    overflow: hidden;
}    
</style>
<div class="pictures">
    <img src="3.jpg">
</div>
Mar.29,2021

css transform: scale (2)


try transform-origin: center

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea00ad-4ef75.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea00ad-4ef75.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?