Adobe Extending Dreamweaver CS4 Uživatelský manuál Strana 231

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 387
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 230
225
EXTENDING DREAMWEAVER CS4
Floating panels
selectionChanged(): is a script marker selected?
The
selectionChanged()
function determines whether a script marker has been selected in Design view. A script
marker appears in Design view if there is a JavaScript routine in the body section of a document and if Scripts is selected
on the Invisible Elements section of the Preferences dialog box. The following figure shows a script marker icon:
The selectionChanged() function first calls the dw.getDocumentDOM() function to get the Document Object
Model (DOM) for the user’s document. It then calls the
getSelectedNode() function to see if the selected node for
that document is, first, an element and, second, a
SCRIPT tag. If both these conditions are true, the
selectionChanged() function makes the scripteditor floating panel visible and loads it with the underlying
JavaScript code. It also sets the
visibility property of the blanklayer floating panel to the value hidden. The
following figure shows the
scriptlayer floating panel with the selected JavaScript code:
If the selected node is not an element, or it is not a script tag, the selectionChanged() function makes the
blanklayer floating panel visible and hides the scriptlayer panel. The blanklayer floating panel displays the text
(no script selected), as shown in the following figure:
Add the selectionChanged() function
1 Open the file scriptEditor.htm that is in the Configuration/Floaters folder.
Zobrazit stránku 230
1 2 ... 226 227 228 229 230 231 232 233 234 235 236 ... 386 387

Komentáře k této Příručce

Žádné komentáře