如何将函数应用于 wysihtml5 texteditor?
How can I apply a function to wysihtml5 texteditor?
像这样我的函数工作正常:
$(".textarea").on("change keyup paste", function (){
console.log("something happens");
});
但是当我想将它应用到我的 wysihtml5 时,它不再起作用了..
$('.textarea').wysihtml5();
$(".textarea").on("change keyup paste", function (){
console.log("something happens");
});
工作解决方案:
$('.textarea').wysihtml5({
events: {
load: function() {
var some_wysi = $('.textarea').data('wysihtml5').editor;
$(some_wysi.composer.element).bind('keyup', function(){
console.log("something happens");
});
}
}
});
像这样我的函数工作正常:
$(".textarea").on("change keyup paste", function (){
console.log("something happens");
});
但是当我想将它应用到我的 wysihtml5 时,它不再起作用了..
$('.textarea').wysihtml5();
$(".textarea").on("change keyup paste", function (){
console.log("something happens");
});
工作解决方案:
$('.textarea').wysihtml5({
events: {
load: function() {
var some_wysi = $('.textarea').data('wysihtml5').editor;
$(some_wysi.composer.element).bind('keyup', function(){
console.log("something happens");
});
}
}
});