发行fancybox2 - $.fancybox。调整大小不是函数错误

[英]Issue with fancybox2 - $.fancybox.resize is not a function - error


Javascript

Javascript

/*Corner by Arthur Wulf White
jquery,  jquery ui and jeditable required
*/
$(document).ready(function()
{
    $("a.magicInput").click(function(e){
        e.preventDefault();
        $("ol.addItems").append('<li>Something</li>');
        $.fancybox.resize();
    });
    $("a.fancy").fancybox(       
    {
        'scrolling' : 'no',
        'autoScale' : true,
        'autoDimensions' : true

    });
    return false;
});

Html

Html

<!DOCTYPE html>
<html>
    <head>
        <meta charset=utf-8 />
        <title>
            studyWise - Log in
        </title>
        <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.20.custom.min.js"></script>
    <script type="text/javascript" src="js/fancy/jquery.fancybox.js"></script>
    <script type="text/javascript" src="js/fancy.js"></script>

        <link rel="stylesheet" type="text/css" media="screen" href="css/reset.css" />
        <link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
        <link rel="stylesheet" href="js/fancy/jquery.fancybox.css" type="text/css" media="screen" />    

    </head>
    <body>
        <div id="wrap">
<div id="menu">
    <a class="fancy" href="#fancybox">Open</a>
</div>
<div id="main">
    <div class="secret">
        <div id="fancybox">
            <a class="magicInput" href="">Ok</a>
            <ol class="addItems">

            </ol>
        </div>
    </div>
</div>
</html>

Result:

结果:

$.fancybox.resize is not a function
[Break On This Error]   

$.fancybox.resize();

fancy.js (line 9)
$.fancybox.resize is not a function
[Break On This Error]   

$.fancybox.resize();

fancy.js (line 9)
$.fancybox.resize is not a function
[Break On This Error]   

$.fancybox.resize();

fancy.js (line 9)
$.fancybox.resize is not a function
[Break On This Error]   

$.fancybox.resize();

All I want is a working example where the fancybox extends/ stretches to fit the whole list inside it. Thanks - it should only be one or two more lines in jsfiddle, please help cause I have no idea why it is not working.

我想要的是一个工作示例,在这个示例中,fancybox扩展/扩展以适应它内部的整个列表。谢谢- jsfiddle应该只有一两行代码,请帮忙,因为我不知道为什么它不能正常工作。

2 个解决方案

#1


12  

You are using fancybox v2.x. Options for this version are new and not compatible with previous versions (1.3.x).

你使用的是fancybox v2.x。这个版本的选项是新的,与以前的版本不兼容(1.3.x)。

$.fancybox.resize() is NOT a valid method for fancybox v2.x, use $.fancybox.update() instead. It is the same case for autoScale and autoDimensions, which are options for v1.3.x

$.fancybox.resize()不是fancybox v2的有效方法。x,使用$ .fancybox.update()。autoScale和autoDimensions也是同样的情况,这是v1.3.x的选项

Check http://fancyapps.com/fancybox/#docs for the right set of options for the version you are using.

查看http://fancyapps.com/fancybox/#docs以获得您正在使用的版本的正确选项集。

#2


-2  

How do you resize Fancybox at runtime?

如何在运行时调整Fancybox的大小?

FancyBox resize width

FancyBox调整宽度

I guess that would help you. From these errors its clearly depicting that there is any JS file missing.

我想这对你有帮助。从这些错误中可以清楚地看出,有任何JS文件丢失。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2012/06/06/3a67622cbe84d57f53c23b0fe2e03e97.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告