在 nyroModal 中手动打开 iframe?

我正在尝试让 nyroModal 直接从 JavaScript 在 iframe 中打开.

I am trying to get nyroModal to open in an iframe, directly from JavaScript.

为了澄清,以下是我需要的不是:

To clarify, the following is not what I need:

$.nmManual(url); // not an iframe

因为它没有打开 iframe.

because it does not open an iframe.

这也行不通:

<a href="http://someurl.com/" target="_blank" class="nyroModal">click me</a>
<script type="text/javascript"> $(".nyroModal").nyroModal(); </script>

因为我确实需要直接从 JavaScript 启动它.

because I really need to launch it directly from JavaScript.

我查看了文档,但找不到任何明显的方法来执行此操作.有什么想法吗?

I've looked through the documentation, and I can't find any obvious way to do this. Any ideas?

推荐答案

$.nmManual 也可用于打开 iframe,使用过滤器:

$.nmManual can also be used to open an iframe, using the filters:

$.nmManual('http://someurl.com/', {
    callbacks: { 
      initFilters: function(nm) {
      nm.filters.push('link');
      nm.filters.push('iframe');
    }
  }
});

相关文章