首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Jquery的Galleria

使用Jquery的Galleria
EN

Stack Overflow用户
提问于 2012-06-26 03:15:16
回答 1查看 972关注 0票数 0

我正在使用Galleria jQuery插件(可以在这个地址上找到:http://galleria.io/),我想知道是否有人可以在代码中指出初始的"Galleria“实例是在哪里创建的。我知道有一个Galleria类和构造函数,但我找不到/不明白初始实例是在哪里创建的。

我怀疑它可能在这里的某个地方:

代码语言:javascript
复制
$.fn.galleria = function( options ) {

var selector = this.selector;

// try domReady if element not found
if ( !$(this).length ) {

    $(function() {
        if ( $( selector ).length ) {

            // if found on domReady, go ahead
            $( selector ).galleria( options );

        } else {

            // if not, try fetching the element for 5 secs, then raise a warning.
            Galleria.utils.wait({
                until: function() {
                    return $( selector ).length;
                },
                success: function() {
                    $( selector ).galleria( options );
                },
                error: function() {
                    Galleria.raise('Init failed: Galleria could not find the element "'+selector+'".');
                },
                timeout: 5000
            });

        }
    });
    return this;
}

return this.each(function() {

    // fail silent if already run
    if ( !$.data(this, 'galleria') ) {
        $.data( this, 'galleria', new Galleria().init( this, options ) );
    }
});

};

非常感谢你的帮助。我是jQuery和Javascript的初学者。

EN

回答 1

Stack Overflow用户

发布于 2012-07-06 19:18:21

它实际上低于这个值:

https://github.com/aino/galleria/blob/master/src/galleria.js#L5687

代码语言:javascript
复制
$.data( this, 'galleria', new Galleria().init( this, options ) );
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11195826

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档