【发布时间】:2015-07-09 14:43:38
【问题描述】:
我已经用 fancyBox v2.1.5 为 Joomla 构建了一个插件。
它在所有浏览器中都运行良好,IE7 除外。 不是什么大问题,但这是我的投资组合网站,所以我希望它也能在这个旧浏览器中运行。
我有一个 iframe,我从联系人插件(响应式联系人表单)中弹出一个表单,该表单不会显示,但谷歌验证码工具在那里。
如果我在新的浏览器窗口中打开页面,表单就会出现。
我尝试设置 iframe: { preload: false } 然后它起作用了,表单在那里,但是fancybox的“Fit To View”在Opera和IE中不起作用,高度出错了。
非常感谢任何帮助!
这是我的 Fancybox 代码:
<script type="text/javascript">
jQuery(window).on('load', function() {
new JCaption('img.caption');
});
(function($){
$(document).ready(function(){$('.item-page').find('a:has(img)').addClass('fancyboxlink');$('.fancyboxlink').addClass('hiddenclass'); $('.hiddenclass:first').addClass('firstfancybox');$('a.fancyboxlink').attr('rel','gallery');
$('a.fancyboxlink').fancybox({
'type':'iframe',
scrolling: 'auto',
fitToView: true,
autoResize: false,
centerOnScroll: true,
width: 940,
height: 'auto',
scrollOutside: true,
autoCenter: true,
titlePossition: 'outside',
afterShow: function() {
if($('.fancybox-iframe').length > 0) {
this.width = $('.fancybox- iframe').contents().find('html').width();
this.height = $('.fancybox-iframe').contents().find('html').height();
$.fancybox.update();
}
},
'afterClose': function() {
$('#fancybox-inner').empty();
}
});
});
})(jQuery);
</script>
【问题讨论】:
标签: jquery forms iframe fancybox internet-explorer-7