jquery fancybox firefox dimensions issue

允我心安 提交于 2019-12-07 15:20:27

If you are using type : "iframe" you may not need to use the media helpers (which actually moves the content inside an iframe).

Also, if you want fancybox to keep fixed dimensions, you would need to add fitToView: false, otherwise fancybox will be resized to fit in the view port for smaller screens.

Additionally, you may need to disable iframe preload to avoid some known issues when the content is not completely loaded (browsers may process the size calculation differently)

so this code should do the trick in Firefox, Chrome and even in IE7+ :

$('.fancybox-media').fancybox({
    type: 'iframe',
    width: 800,
    height: 580,
    // add
    fitToView: false,
    iframe : {
      preload : false
    }
});
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!