- <button class="tXinpField">普通域</button> <div class="obj">
- <OBJECT classid="clsid:1b635021-8269-11d8-9e2b-004005a9abd2" id=objTX width=595 height=842>
- <PARAM NAME="ViewMode" VALUE="1">
- <PARAM NAME="ScrollBars" VALUE="">
- <PARAM NAME="PageWidth" VALUE="8888">
- <PARAM NAME="PageHeight" VALUE="12000">
- <PARAM NAME="Text" VALUE="When set to true the loaded data replaces the current selection or is inserted at the current input position. The new input position is behind the inserted data. When omitted or set to false the loaded data replaces the complete control contents independent of the current selection. The new input position is at the beginning of the data'">
- </OBJECT>
- </div>
复制代码
这是HTML
- // 普通域
- $(".tXinpField").on('click', function () {
- var i = objTX.FieldAtInputPos;
- if (i > 0) {
- alert('不允许在域内插入新的域!');
- } else {
- objTX.ForeColor = 0;
- objTX.LoadFromMemory("姓名:", 1, true);
- objTX.FormatSelection = true;
- objTX.ForeColor = 255;
- objTX.FontUnderline = 2;
- var text = objTX.fieldinsert('小小');
- objTX.FieldCurrent = '854235';
- // 设置包含文本
- // objTX.FieldText = '你是谁啊';
- // 获取到标记文本的存储编号
- FieldId = objTX.FieldCurrent;
- FieldId.FontUnderline = 2;
- // objTX.FieldData(FieldId,'1123');
- // objTX.FieldEditAttr(FieldId,2);
- // 指定标记文本字段的内容是否可由用户更改
- // objTX.fieldchangeable = false;
- // // 指定标记文本字段的内容是否可由用户删除
- // objTX.fielddeleteable = true;
- // 返回标记文本字段的开始位置
- var start = objTX.FieldStart;
- // 返回标记文本字段的结束位置
- var end = objTX.FieldEnd;
- // 返回标记文本字段的水平位置
- var posX = objTX.FieldPosX;
- // 返回标记文本字段的垂直位置
- var posY = objTX.FieldPosY;
- objTX.ForeColor = 0;
- s1 = ","
- objTX.loadfrommemory(s1, 1, true)
- // FieldClicked(FieldId);
- console.log(FieldId, i, start, end, posX, posY);
-
- }
- })
复制代码
这是JS |