FancyBox iframe returns parent.$ as undefined (using WordPress)

前端 未结 9 2951
无人共我
无人共我 2020-12-04 01:58

I\'m trying to close FancyBox from within the iframe, but parent.$ is always undefined. This is my iframe JavaScript:

 

        
9条回答
  •  忘掉有多难
    2020-12-04 02:18

    Spent quite a few hours trying to debug this and got nowhere. So I switched out the 'FancyBox for WordPress' plugin with the latest version of FancyBox, and it was fixed. Really should have tried that earlier.

    After having spent some time with WordPress and its various plugins, I'd recommend calling things manually rather relying on plugins. It just adds another layer of complexity that, if you know what you're doing, doesn't need to be there.

    Thanks to Doug for pointing out the appropriate syntax for iframe to parent window jQuery in WordPress.

提交回复
热议问题