var Card = YClass.extend({
// define Class Name
className:'Card',
// class level default options
config:{
id:'cardid',
container:'body', // id of container in which to render the user
render:false,
template: 'tmpl_card', // id of template used to render user
debug:false
},
setposition:function() {
var i=1;
var xpos=10;
var ypos=15;
var recvflag=false;
}
);
how i can call set position function i am trying by Card.setposition();
but its giving me error that setposition is not defined
why??
It’s not really a jQuery thing, it’s a YClass thing. I don’t know what YClass is, but my guess is that it defines classes, which you then make instances of:
This would be similar to Resig’s “Simple JavaScript Inheritance”
Classthing, Prototype’sClassobject, or the system I describe here.If you just want a container with some functions on it, you can just do that directly:
…but I’m guessing you’re using YClass for a reason.