我在Firefox上面临这个奇怪的问题,我的代码给了我一个错误:
TypeError:keyboard。$ keyboard.prepend不是函数
代码在Chrome上正常运行。以下是之前的内容 -
initialize: function(options) {
KText = options.KText;
KBID = '#' + KText.id +'_keyboard';
$(KText).keyboard({
layout : this.KeyBoardLayout,
display : $.keyboard.display1,
visible: function(e, keyboard, el) {
keyboard.$keyboard.prepend("<h2 id='dragKB'></h2>");
$( "#dragKB" ).draggable({
target : '#' + KText.id +'_keyboard'
});
}
});
我尝试过这样做,但没有成功:
visible: function(e, keyboard, el) {
var btn = keyboard.$keyboard;
btn.prepend("<h2 id='dragKB'></h2>");
$( "#dragKB" ).draggable({
target : '#' + KText.id +'_keyboard'
});
}
任何指针?我该如何解决这个问题?