kiba自制文本编辑器

上传人:小** 文档编号:88101454 上传时间:2019-04-19 格式:DOC 页数:4 大小:31KB
返回 下载 相关 举报
kiba自制文本编辑器_第1页
第1页 / 共4页
kiba自制文本编辑器_第2页
第2页 / 共4页
kiba自制文本编辑器_第3页
第3页 / 共4页
kiba自制文本编辑器_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《kiba自制文本编辑器》由会员分享,可在线阅读,更多相关《kiba自制文本编辑器(4页珍藏版)》请在金锄头文库上搜索。

1、*margin:0;padding:0;* html body overflow: visible;* html iframe, * html frame overflow: auto;* html frameset overflow: hidden;htmlmargin:0 auto; body div,body pmargin:0;padding:0; bodycolor:#575757; font:12px/22px Verdana,Arial,sans-serif,Times New Roman,;text-align:center; body,ul,ol,li,p,h1,h2,h3,

2、h4,h5,h6,form,fieldset,table,td,img,div,trmargin:0;padding:0; input,selectfont-size:12px;vertical-align:middle; body divtext-align:left; .bb .bb pmargin:0;padding:0; .biaoqian width:55px; background-color:#CDA29C; color:#F12563; border:1px solid #F12563; margin-left:5px; margin-top:5px; height:20px;

3、 line-height:20px; float:left; font-size:12px; cursor:pointer; text-align:centerkiba自制文本编辑器 function $(id)return document.getElementById(id); var is_IE=(navigator.appName=Microsoft Internet Explorer)?true:false; var iframe=null; function init() iframe=$(iframe); textarea=$(area); var html=; iframe.c

4、ontentWindow.document.open(); iframe.contentWindow.document.write(html); iframe.contentWindow.document.close(); if(is_IE) iframe.contentWindow.document.body.contentEditable=true; else iframe.contentWindow.document.designMode=on; run(); function run() insertHTML(*margin:0;padding:0;); function insert

5、HTML(html) if(is_IE) iframe.contentWindow.focus(); var orange=getSelected().createRange(); orange.pasteHTML(html); var tagfont = document.frames(0).document.all.tags(body); if (tagfont!=null) for(i=0; itagfont.length; i+) tagfonti.style.fontSize=12px; tagfonti.style.fontFamily=Arial; else document.e

6、xecCommand(insertHTML,html); var tagfont = document.frames(0).document.all.tags(body); if (tagfont!=null) for(i=0; itagfont.length; i+) tagfonti.style.fontSize=12px; tagfonti.style.fontFamily=Arial; function getSelected() return iframe.contentWindow.document.selection; function swapMode() if(iframe.

7、style.display=none) iframe.contentWindow.document.body.innerHTML=textarea.value; textarea.style.display=none iframe.style.display= document.getElementById(yuanma).innerHTML=编辑界面; else textarea.value=iframe.contentWindow.document.body.innerHTML; textarea.style.display= iframe.style.display=none docum

8、ent.getElementById(yuanma).innerHTML=显示源码; function MyFontSize() iframe.contentWindow.document.body.innerHTML=+iframe.contentWindow.document.body.innerHTML+; textarea.value=iframe.contentWindow.document.body.innerHTML; var tagfont = document.frames(0).document.all.tags(div); if (tagfont!=null) for(i=0; itagfont.length; i+) tagfonti.style.fontSize=24px; tagfonti.style.fontFamily=Arial; 显示源码 文字大小 上传图片

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 管理学资料

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号