fancybox 2 iframe大小不变 [英] fancybox 2 iframe size does not change

查看:294
本文介绍了fancybox 2 iframe大小不变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用fancybox打开外部网址。
我厌倦了fancybox-html类的代码a href:

I'm using fancybox to open external urls. I tired this code for fancybox-html class a href:

$(document).ready(function() {  
    $(".fancybox-html").fancybox({
    fitToView   : false,
    width       : '90%',
    height      : '90%',
    autoSize    : false,
    closeClick  : false,
    openEffect  : 'none',
    closeEffect : 'none'
    });
});

HTML:

    <script type="text/javascript" src="http://localhost:8000/media/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="http://localhost:8000/media/js/jquery.pageslide.min.js"></script>

    <script type="text/javascript" src="http://localhost:8000/media/js/autocomplete.js"></script>
    <!-- <script type="text/javascript" src="http://localhost:8000/media/js/overlay.js"></script> -->

    <!-- FancyBox -->
    <link href="http://localhost:8000/media/fancybox/jquery.fancybox.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="http://localhost:8000/media/fancybox/jquery.fancybox.pack.js"></script>
    <script type="text/javascript" src="http://localhost:8000/media/fancybox/jquery.easing-1.3.pack.js"></script>
    <script type="text/javascript" src="http://localhost:8000/media/fancybox/jquery.mousewheel-3.0.6.pack.js"></script>

这不起作用,iframe以不同的尺寸打开,就像忽略我的设置一样。
可以调试吗?

this did not work, the iframe opens in different dimensions like it ignores my settings. is it possible to debug it?

也许我错过了一些库。

任何想法?

推荐答案

首先,您必须下载最后一个fancybox才能确定。
将js和css包含到您的页面中,如果是iframe,请尝试使用此代码。
如果不起作用,请发布你的html,看看你是否有错误

First you have to download the last fancybox to be sure. Include the js and the css into your page then, try to use this code if is an iframe. If doesn't work post your html please to see if you have an error

     $(".fancybox-html").fancybox({ 
width    : '75%', 
height   : '75%', 
autoSize    : false, 
closeClick  : false, 
fitToView   : false, 
openEffect  : 'none', 
closeEffect : 'none', 
type : 'iframe' 
});


<a href="yourpage.php" class="fancybox-html">test test</a>

这篇关于fancybox 2 iframe大小不变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆