直接说问题,在一个页面有多个kindeditor编辑器,我想在点击编辑器里的图标时,同时获取该图标的父级元素class,或者和该kindeditor编辑器对应的textarea的id,代码如下:
调用kindeditor的代码,我删了一些不太重要的代码,尽量精简清晰:
editor = K.create('textarea[id="content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'emoticons', 'image', 'mathtype']
});
mathtype这个图标是我自定义的一个,里面的代码如下
KindEditor.plugin('mathtype', function(K) {
var self = this, name = 'mathtype';
self.clickToolbar(name, function() {
//代码
});
});
我用了下面几种办法,都不行,请大神指点下,谢谢啦:
$(this).parent(".ke-container").class();
$(this).closest(".ke-container").class();
K(this).parent(".ke-container").class();