Autor Beitrag
Steven
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57



BeitragVerfasst: Sa 11.10.03 15:00 
es geht darum in einem editierbaren webbrowser text einzufügen den ich mit der "2d-position" dann verschieben möchte. ich habe aber nur dieses javascript, wer mag mir dabei helfen das mit delphi zu machen?

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
<!-- The fnInsertText function inserts an text DIV into the editable card -->
<!-- region.  The new DIV has a unique ID.                                -->     
function fnInsertText(oTxtId,oTxtFont) {
    var oNode=document.createElement("div");
    card.insertBefore(oNode);
    oNode.style.fontFamily=oTxtFont;
    oNode.innerText='Geben Sie bitte hier ihren Text ein';
    giLastTxt++;
    var iTempCount = "text" + giLastTxt;
    oNode.id = iTempCount;
    oNode.style.position='absolute';
    
    <!-- Set the new text as the active element for editing. -->
    oNode.setActive()
}


habs so versucht
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Button1Click(Sender: TObject);
var
  HTMLDocument2Ifc: IHTMLDocument2;
  fname, fnameb: string;
begin

  HTMLDocument2Ifc := WebBrowser1.Document as IHTMLDocument2;
    HTMLDocument2Ifc.execCommand('createElement', false, 'div');
end;