2
我使用codemirror创建自己的语言,当我停止使用函数的名称并将其悬停或按下时,我想要执行的操作(Ctrl + I)显示工具提示显示此函数的类型和其他数据上jsfiddle.net代码运行而不是在jsbin.com为什么jsfiddle.net上的代码无法在jsbin.com中工作?
var cm = CodeMirror(document.getElementById("editor"), {
value: "function myScript() {\n return 100;\n}",
indentUnit: 4,
lineNumbers: true
});
var textMarker;
$('#add').click(function() {
textMarker = cm.markText({
line: 1,
ch: 4
}, {
line: 1,
ch: 10
}, {
className: 'marked-text'
});
$('.marked-text').tooltip({
title: 'This is a return statement',
container: 'body',
delay: { "show": 500, "hide": 100 },
animation: false
});
});
$('#remove').click(function() {
if (textMarker) {
textMarker.clear();
}
});
链接运行工作代码:here code works
我的尝试,但不起作用:my try
PLZ看到代码,我添加库“外部资源”从下到的jsfiddle我jsbin问@范·罗德里格斯·托雷斯 – code
检查更新@code之前 –
确定它在你改变工作谢谢@伊万·罗德里格斯·托雷斯 – code