TextRange Object

the rectangle that bounds the TextRange object and the left side of the object that contains the TextRange.boundingTopRetrieves the distance between the top edge of the rectangle that bounds the TextRange object and the top side of the object that contains the TextRange. boundingWidthRetrieves the w
http://www.w3dev.cn/article/20100430/2305.aspx

DHTML之textRange对象

TextRange对象是动态HTML(DHTML)的高级特性,使用它可以实现很多和文本有关的任务,例如搜索和选择文本。文本范围让您可以选择性的将字符、单词和句子从文档中挑选出来。TextRange对象是在HTML文档将要显示的文本流上建立开始和结束位置的抽象对象。下面是TextRange的常用属性与方法:属性 boundingHeight 获取绑定TextRange对象的矩形的高度 boundingLeft 获取绑定TextRange 对象的矩形左边缘和包含TextRange对象的左侧之间的距离 offsetLeft 获取对象相对于版面或由offsetParent属性指定的父坐标的计算左侧位置
http://www.w3dev.cn/article/20090603/62.aspx

html编辑器回车换行如何指定为br

ment.body; editor.addEventListener ? editor.addEventListener('keydown', keydown, true) : editor.attachEvent('onkeydown', keydown); }, 10); }/script  主要使用到了selection和range 2个主要的对象,具体参考,前2个是w3c浏览器标准,最后的为IEselection对象中文APIRange对象中文APIDHTML之textRange对象,更多参考:TextRange
http://www.w3dev.cn/article/20141105/html-editor-enter-replace-to-br.aspx

__defineGetter__和__defineSetter__介绍

now! { var textRange = this.ownerDocument.createRange(); //Using range to retrieve the content of the object textRange.selectNodeContents(this); //only get the content of the object node return textRange.toString(); // give
http://www.w3dev.cn/article/20130903/defineGetter-defineSetter.aspx

IE,firefox,opera浏览器Range对象介绍

ozilla, Safari 和 Opera浏览器中userSelection是一个Selection对象,而在IE中却是TextRange对象。这种不同在其余的代码中也是存在 的,也就是说,IE的TextRange不同于Mozilla的Selection和W3C的Range对象,后续的代码必须针对IE和其他浏览器单独处 理。  处理的顺序需要注意,Mozilla的Selection应该首先处理,原因是Opera浏览器支持这两个对象 (Selection和TextRange),如果你使用window.getSelection()来读取用户选择区域, Opera创建一个 Selection对象,
http://www.w3dev.cn/article/20121119/IE-firefox-opera-Range.aspx

C#在PowerPoint文档中搜索文本

VBAPP10.CHM,根据对象模型图,很容易找到我们需要的几个集合和对象:Application、Presentations、Presentation、Slides、Slide、TextFrame、 TextRange。其中Presentation代表一个 PowerPoint 文档,Slide表示PowerPoint文档中的单张幻灯片,TextFrame是幻灯片上的文本框,TextRange是文本框中的文本。  打开PowerPoint文档:+展开-C#stringfilename="";PowerPoint.Applicationpa=newPowerPoint.ApplicationC
http://www.w3dev.cn/article/20120304/csharp-search-text-in-PowerPoint.aspx

在Web页面中控制其元素的选择状态

本框内实现选择效果,在页面上屏蔽选择状态等。我们需要使用脚本(如JavaScript)来精确的控制页面中UI元素的选择状态。下面从操作元素选择区和屏蔽元素被选择两个方面来说一说。 操作元素选择区,我们可以使用对应对象的select()方法选择页面内容,其中包括INPUT元素中的内容、TextRange对象中的文字和controlRange Collection对象中的控件。 1、 Select Input+展开-HTMLinputid="txb"type="text"value="TextBox"/ahref="#"onclick="document.getElementById
http://www.w3dev.cn/article/20100430/2301.aspx

createRange Method

Creates a TextRange object from the current text selection, or a controlRange collection from a control selection. Syntaxrange = object.createRange()Return ValueReturnsthe created TextRange object.Standards InformationThere is no public standard that applies to this method. Applies Toselection, Sel
http://www.w3dev.cn/article/20100430/2304.aspx

createTextRange Method

Creates a TextRange object for the element.SyntaxoTextRange = object.createTextRange()Return ValueReturnsa TextRange object if successful, or null otherwise. RemarksUse a text range to examine and modify the text within an object.ExamplesThis example uses the createTextRange method to create a text
http://www.w3dev.cn/article/20100430/2306.aspx

Selection Prototype

odDescriptionclearClears the contents of the selection. createRangeCreates a TextRange object from the current text selection, or a controlRange collection from a control selection. createRangeCollectionCreates a TextRange object collection from the current selection. emptyCancels the current selec
http://www.w3dev.cn/article/20100430/2307.aspx

selection Object

ieves a collection of TextRange objects.EventsEventDescriptionontimeerrorFires whenever a time-specific error occurs, usually as a result of setting a property to an invalid value.MethodsMethodDescriptionclearClears the contents of the selection. createRangeCreates a TextRange object from the curre
http://www.w3dev.cn/article/20100430/2308.aspx

4.7.为一段文本设置风格属性

.7.2. 解决部分使用TextRange 类设置一段字符的属性。4.7.3. 讨论TextRange 类接受一个拥有TextField 的组件。用一个参数指明是否通过TextRange 中的属性设置来对该组件进行修改,然后用2 个整数决定TextField 中的起始字符和结束字符。TextRange 对象是这样构造的:+展开-ActionScriptvartextRange:TextRange=newTextRange(component:UIComponent,modify:Boolean,startIndex:int,endIndex:int);TextRange 对象的属性影响了载入的
http://www.w3dev.cn/article/20100310/1858.aspx

浏览器滤镜大全

RandomBarsOrientationText=;function copy2Clipboard(){// Copy displayed code to user's clipboard.var textRange = document.body.createTextRange();textRange.moveToElementText(oCodeSpan);textRange.execCommand(Copy);}function highlightText(whatToHighlight) {var oRng = document.body.createTextRange();
http://www.w3dev.cn/article/20090710/484.aspx

求textarea框ctrl+z为什么无效?

(textareaObj.createTextRange){ var textRange=textareaObj.createTextRange(); var enterMatch=textareaObj.value.substr(0,maxLength).match(/\n/ig); var enterNum=0; if(enterMatch) enterNum=enterMatch.length textRange.moveStart('character',maxLength-enterNum); textRange.select(); } else { textareaObj.foc
http://www.w3dev.cn/article/20090701/376.aspx