1

I have some namespace utilities that I want to create multiple instances of, but can't seem to get it working.

My module looks like:

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);
};

When I try to do something like

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"

How can I do this so it works properly?

code-jaff
  • 9,230
  • 4
  • 35
  • 56
JonMorehouse
  • 1,313
  • 6
  • 14
  • 34

0 Answers0