calin-beard
10/6/2017 - 9:56 AM

Get the width and height of parent .widget-html for embedded maps

Get the width and height of parent .widget-html for embedded maps

<script>
    $(document).ready(function() {
        var $maps = $('iframe[src*="www.google.com/maps"]');
        $maps.each(function(i, e) {
            var styles = $(e).closest('.widget-html').css(['width', 'height']);
            $(e).css(styles);
        });
    });

</script>