2
我想知道是否有一种方法可以在运行时在featherlight.js中延迟加载iFrame,而不是在html中声明iFrame?这样,可以简单地通过data属性或href属性指定要加载到页面的url,而不是使用iFrame声明。例如,而不是在我的HTML文件中像这样声明的iFrame:在featherlight.js中延迟加载iframe
<a class="btn btn-default" href="#" data-featherlight="#fl3">iFrame</a>
....
<iframe class="lightbox" src="www.google.com" id="fl3" style="border:none;" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" height="281" width="500"></iframe>
我愿做这样的事情:
<a href="#" data-featherlight="www.xyz.com"></a>
我也知道如果与一些结束代替上述网址.html它工作正常。我的想法是写另一内容过滤器“外部”网站/沿下方的线contant..something的:如果
external: {
regex: /[[email protected]:%._\+~#=]{2,256}\.[a-z]{2,6}\b([[email protected]:%_\+.~#?&//=]*)/,
process: function(url) {
var self = this,
var $container = $("<iframe id='featherlight-iframe'/>");
$container.attr('src', url);
........
}
},
不知道这是正确的做法,但。任何帮助,将不胜感激。
预先感谢您。
太棒了!谢谢你1.2 :-)非常感谢你! – MojoJojo 2015-02-24 20:45:25