IFrame 系列1 ----designMode和contentEditable属性全方位解析
来源:互联网 发布:27岁未婚单身女 知乎 编辑:程序博客网 时间:2024/05/16 07:40
pre{ font-family: courier new!important; font-size: 12px!important; word-wrap: break-word; white-space: pre-wrap; background-color: rgb(245, 245, 245); font-family: courier new!important; font-size: 12px!important; border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0; color: rgb(0, 0, 0); .anikin_p{ line-height: 24.5px; color:red; margin-top: 15px; margin-bottom: 25px; padding: 15px 20px; box-sizing: border-box; border-width: 0px 0px 0px 5px; border-left-style: solid;border-left-color: rgb(0, 163, 207); font-family: " font-size: 14px; outline: 0px; vertical-align: baseline; overflow: hidden; color: rgb(119, 119, 119);background: rgb(246, 246, 246);}.anikin_strong{ line-height: 24.5px; box-sizing: border-box; border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;
DesignMode 跟 contentEditable 这个两个属性一般常用在 iframe中,在富文本编辑器之类中反光发热。
实现可视化编辑,可以使用contentEditable和designMode两种方法。 contentEditable 刚开始在IE上实现,后来各大浏览器陆续支持contentEditable,HTML5标准也包含 contentEditable。
[1]: designMode 只能把 document整体改成可编辑状态
[2]: contentEditable 可以把任何HTML元素改成可编辑状态
var ifr = document.getElementById("editor"); // iframe 的id 位editor
var doc = ifr.contentDocument || ifr.contentWindow.document; // W3C || IE 方式获取iframe的文档对象
doc.designMode= "on";
doc.contentEditable= true;
0 0
- IFrame 系列1 ----designMode和contentEditable属性全方位解析
- designMode和contentEditable的属性的介绍
- 编辑器中designMode和contentEditable的属性的介绍
- div可编辑contentEditable和designMode
- 禁用webkit textarea可调整大小和文本框焦点时边框 , contenteditable 和designMode
- IFrame 系列4 ---- document.selection 全方位兼容解析以及TextRange[createTextRange,createRange]对象的深入解析
- 关于JS的contentDocument,contentEditable,designMode
- 2.2.1新增-contentEditable属性
- contentEditable属性
- contenteditable属性
- 激活编辑器的两种方式:contentEditable与designMode
- 重新认识HTML系列004——全局属性contenteditable
- 2.2.2新增-designMode属性
- 实用的属性:contentEditable
- html contentEditable属性
- HTML5之contenteditable属性
- HTML5 contenteditable 属性
- div添加contenteditable属性
- 类变量、成员变量、实例变量、局部变量、静态变量、全局变量的解释
- uploadfy上传插件汇总
- 发送url请求的方法
- H5文件操作API汇总
- js中粘贴、复制、剪切操作汇总
- IFrame 系列1 ----designMode和contentEditable属性全方位解析
- git相关
- IFrame 系列2 ---- contentWindow跟execCommand全面解析
- 《深入理解java虚拟机》学习笔记
- IFrame 系列3 ---- js选中文字API: setSelectionRange跟createTextRange
- IFrame 系列4 ---- document.selection 全方位兼容解析以及TextRange[createTextRange,createRange]对象的深入解析
- Caffe学习日记7
- Python入门笔记
- webpack