Back to Editor Md

On / Off (bind/unbind) event handle

examples/on-off.html

1.5.0772 B
Original Source

Example javascript { onscroll : function(event) { console.clear(); console.log("onscroll =\>", this, this.id, this.settings, event); }, onpreviewscroll : function(event) { console.clear(); console.log("onpreviewscroll =\>", this, this.id, this.settings, event); }, onload : function() { this.off("previewscroll"); // unbind before handle // Override settings.onpreviewscroll this.on("previewscroll", function(){ console.clear(); console.log("on() =\> Override settings.onpreviewscroll =\>", this, this.id, event, (new Date).getTime()); }); // defined event bind this.on("resize", function(){ console.clear(); console.log("onresize =\>", this, this.id, event, (new Date).getTime()); }); } } // Or editor.on("resize", function(){ // ... }); editor.off("resize");