jQuery(function ($) {
    var instagram = function () {
        if (document.getElementById(creacsocial.target_id) != null) {
            var feed = new Instafeed({
                limit: parseInt(creacsocial.maxposts),
                target: creacsocial.target_id,
                accessToken: creacsocial.access_token,
                template: creacsocial.response_template
            });
            feed.run();
        }
        var _instaitems = $('.instagram-item')
        $.each(_instaitems, (index, value) => {
            var _ancho = $(_instaitems).first().width()
            $('.inst-imagen', value).height(_ancho)
        });
    }

    $(document).ready(function () {
        instagram();
    });

    $(window).resize(function () {
        instagram();
    });
});
