Skip to content

When click Image and show clicking Image in popup in magento 2

How to create, When click Image and show clicking Image in popup.

This is my code :-

echo "<td>"?><img src="<?php echo $this->getMediaUrl() .'brand'. $data->getImage(); ?>" width="100px" height="100px" class="click-header"></td>

JS Code :-

<script type="text/javascript">
require([
    'jquery',
    'Magento_Ui/js/modal/modal'
], function($, modal) {
    $(document).ready(function() {
        var options = {
            type: 'popup',
            responsive: true,
            innerScroll: true,
            img: '$(".click-header").attr("src", $(this).attr("src"));'
        };
        $(".click-header").on('click', function() {
            $("#header-mpdal").modal(options).modal('openModal');
        });
        // $('.modal-footer').hide();
    });
});
</script>

Out Put Show Blank :-

enter image description here

THANKS.