Applying Styles To Selected Text - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide
The Advanced tab lists each single style ( HTMLStyle ) in the style set ( HTMLStyleSet ) being edited.
The Name column shows the single style element each HTMLStyle object represents.
The Attribute column shows the name of any attribute the style element provides.
The Value column shows the attribute's value.
For example, suppose that the active Layout view shows the following HTML source code:
<p>This is a <b>very <i>stylish </i> text</b> example </p>
Both bold and italic styles affect the stylish text. If stylish is selected, its document's
mainTextArea.styleset property provides an HTMLStyleSet containing two HTMLStyle objects
that represent these styles. The first provides this style information:
name="b" attribute="" value=""
The second provides this style information:
name="i" attribute="" value=""
When you use the Edit Style palette or the SDK to change this style set or its individual styles, the content
of the text area in Layout view changes immediately, and the changes are available to JavaScript callers
immediately.

Applying styles to selected text

Use the
applyStyle
this method the raw HTML text that defines the style, an HTMLStyleSet object that contains multiple
styles to apply, or a single HTMLStyle object.
This example center-justifies the contents of the <body> element:
document.mainTextArea.selectAll( );
document.mainTextArea.applyStyle("div align=center");
Adobe GoLive CS2 SDK
method of the textArea object to apply HTML styles to selected text. You can pass
Editing with Layout
116

Advertisement

Table of Contents
loading

Table of Contents