I want define defaults for my plugin, this is javascript code:
var opts = {
'width': 957,
'height': 590,
'left': ($(window).width() / 2) - (this.width),
'top': ($(window).height() / 2) - (this.height)
};
but opts.left return NaN.
what is problem?
EDIT: I want use width from my object in my object.
this.widthisn’t a numeric value.Update based on the comment:
thisisn’t the object, it the caller of the function. sothis.widthwon’t give you thewidthof the property.Working LIVE DEMO