Instagram embeds not working when adding embeds dynamically

前端 未结 3 1310
南旧
南旧 2020-12-07 00:44

Working on a blog that loads posts on an infinite scroller. Each blog post may or may not have Instagram embeds. I\'m finding that the first one that shows on the page wil

3条回答
  •  半阙折子戏
    2020-12-07 01:37

    The embed.js script that comes with Instagram's embed code has a process function you can call.

    window.instgrm.Embeds.process()
    

    Just use that whenever your dynamic content loads.

提交回复
热议问题