尼斯编辑点击问题
NiceEdit click issue
我在我的winforms中使用了nicEditor,通过加载Web浏览器并在其中加载nicEditor。默认情况下,当编辑器加载时,然后我在编辑器中间单击焦点不会转到 nicEditor。但是,如果我在编辑器的开头单击右侧,焦点将设置为编辑器。以下是我的 HTML 文件代码。
<html>
<head>
<script type="text/javascript">
var myInstance = "";
function GetContent() {
//window.alert(""+myInstance);
//var content = tinyMCE.get('tinyMceEditor').getContent();
//content = content.replace("<body>", "<body style='"font-size:10px;'">");
//var content = nicEditors.get('area3').getContent();
var content = myInstance.instanceById('editor').getContent();
//window.alert(myInstance.instanceById('editor').getContent());
return content;
}
function SetContent(htmlContent) {
setTimeout(function () {
//window.alert(htmlContent);
//nicEditors.get('area3').setContent(htmlContent);
myInstance.instanceById('editor').setContent(htmlContent);
if (htmlContent == undefined || htmlContent == '')
myInstance.instanceById('editor').setContent('');
//tinyMCE.get('tinyMceEditor').readOnly = true;
}, 100);
}
</script>
<script type="text/javascript" src="jscripts/nicEdit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function () {
//myInstance = new nicEditor().panelInstance('editor');
myInstance = new nicEditor({ maxHeight: 388 }).panelInstance('editor');
//nicEditors.allTextAreas()
});
</script>
</head>
<body style="margin-top: 0px; margin-left: 0px;">
<div id="sample">
<textarea id="demo" cols="50" id="editor" name="editor" style="width:295px;" >
</textarea>
</div>
</body>
</html>
请帮忙。
它以这种方式工作。但是我没有得到您使用以下脚本尝试做的事情.
<script type="text/javascript">
bkLib.onDomLoaded(function () {
//myInstance = new nicEditor().panelInstance('editor');
myInstance = new nicEditor({ maxHeight: 388 }).panelInstance('editor');
//nicEditors.allTextAreas()
});
</script>
这是我的简单 HTML . 现在让我知道你到底想做什么.
<html>
<head>
</head>
<body style="margin-top: 0px; margin-left: 0px;">
<div id="sample">
<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
<script type="text/javascript">
//<![CDATA[
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
//]]>
</script>
<textarea id="demo" cols="50" id="editor" name="editor" style="width:295px;" >
</textarea>
</div>
</body>
</html>
寻找这样的东西,如果我在任何地方都错了,请告诉我。
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
</head>
<style type="text/css">
.heightClass {
min-height: 338px !important;
}
</style>
<body style="margin-top: 0px; margin-left: 0px;">
<div id="sample">
<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
<script type="text/javascript">
//<![CDATA[
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
//]]>
$(document).on("focus" , ".nicEdit-selected" , function () {
var parentTag = $( this ).css("height" , "338px");
//$( this ).addClass("heightClass");
//alert(parentTag);
});
</script>
<textarea id="demo" cols="50" id="editor" name="editor" style="width:295px;" >
</textarea>
</div>
</body>
</html>
相关文章:
- ExtJS网格单元格编辑器,防止焦点松动问题
- THRE.js编辑器中的鼠标问题
- 传单圆圈绘制/编辑问题
- 在jqGrid编辑对话框中使用ptTimeSelect时出现问题
- Infrastics网络货币编辑舍入问题
- 使用jQuery日期选择器编辑单元格时出现AngularJS ngGrid问题
- 两个用户通过 websocket 编辑输入时出现问题
- Nic编辑新的上传IE问题
- 内容可编辑占位符问题
- 尼斯编辑点击问题
- 内容可编辑属性的问题
- 当我单击编辑表单时,角度自动填充创建表单的问题
- 模板和页面编辑器中的图像的Web设计问题
- 编辑JQuery文档时出现问题
- 编辑:I'我的按钮及其功能有问题
- jqGrid可编辑问题
- Knockout-弹出问题编辑项目
- 博客编辑问题
- Ace代码编辑器出现问题
- 就地编辑问题