【问题标题】:prettyphoto iframe漂亮照片 iframe
【发布时间】:2013-04-10 06:03:10
【问题描述】:

我正在使用 prettyphoto 在 iframe 中显示网页。有谁知道包含网页 http:// 引用的唯一值的元素 id?由于他们没有 id,我想我可以使用它。

谢谢。

我正在到达某个地方。

警报($("#pp_full_res").html());

给我

iframe src="http://xxxx.com/zzz/html" iframeborder="no" height="640" 等等等等

我怎样才能只获取 src?

谢谢

【问题讨论】:

    标签: prettyphoto


    【解决方案1】:

    在您上面的示例的基础上,为了获得实际的 iframe src,您可以使用 JQuery 的 attr() 方法。

    var sSrc = $("#pp_full_res").attr('src');

    【讨论】:

      【解决方案2】:

      您可以在初始化 prettyPhoto 时设置自己的 iframe 参考:

      $("a[rel^='prettyPhoto']").prettyPhoto({
        iframe_markup: '<iframe id="name-here" name="name-here" src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
      });
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-03-30
        • 1970-01-01
        相关资源
        最近更新 更多