有人可以解释覆盖默认属性,甚至在我的插件示例中使用jQuery扩展它们以及闭包函数
$.fn.myObject = function(overwriteProperties) {
var properties = {myproperty1: "defaultvalue"}
// overwrite properties here
function doStuffHere() {
}
return (function() {
return this; // does this part here refer to the object of myDiv
});
}
$('#myDiv').myObject({myPoperty1:"newValue"});