I want to override js function in this way:
var elements = {
"Element": {
name: Element,
events: ["focus","blur"]
},
"Window": {
name: Window,
events: ["scroll"]
}
}
$.each(elements, function( k, v ) {
$.each(v.events, function( i, val ) {
if (val) {
console.log(v.name.prototype[val]);
v.name.prototype[val] = function () {
return false;
}
}
});
});
Update: fixed, does anyone have suggestions how to make it better?
Aucun commentaire:
Enregistrer un commentaire