1

我有一些命名空间实用程序,我想创建多个实例,但似乎无法使其正常工作。

我的模块看起来像:

Project.utilities.gallery.position = (function() {

// WILL CREATE THE BUBBLES FOR THE SLIDESHOW AND WILL THEN MOVE THEM AUTOMATICALLY AFTER BEING TRIGGERED

var slide_container, position_container;    
var create = function(_container) {//this function will be responsible for creating the bubbles for the slideshow

    if (typeof _container == "undefined"){
        return false;
            }

    slide_container = _container.children('.content');      
    slide_container = _container;
};

var update = function() {//this will be responsible for updating the slideshow!     
    console.log(slide_container);
};

当我尝试做类似的事情时

var test = Project.utilities.position;
test.create("hello world from test");

var test_2 = Project.utilities.position;
test_2.create("Hello world from test_2");

test.update() // outputs "hello world from test_2", not "hello world from test"

我该怎么做才能正常工作?

4

0 回答 0