jquery plugin - calling methods -


so building first plugin jquery have init method

init: function(options, elem) { var self = this; 

this calls couple of methods this.slide(elem); this.lightbox(elem);

however in lightbox method try , call custom method setpositon using

self.setposition(); //error object [object window] has no method 'setposition'

or

this.setposition() // object # has no method 'setposition'

how refer object created?

var myobj = {      init: function(){          var self = this;          this.alert();          myobj.alert();          self.alert();      },      alert: function(){          alert('im called!');      }   }; 

myobj.init();​

see on jsfiddle.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -