MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Dokumentacja Strona 298

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 504
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 297
298 Floating Panels
Example
// the following instance of displayHelp() opens
// in a browser a file that explains how to use
// the extension.
function displayHelp(){
var myHelpFile = dw.getConfigurationPath() +
'/ExtensionsHelp/superDuperHelp.htm';
dw.browseDocument(myHelpFile);
}
documentEdited()
Description
This function is called when the floating panel becomes visible and after the current series of
edits is complete; that is, multiple edits might occur before this function is called. This
function should be defined only if the floating panel must track edits to the document.
Arguments
None.
Returns
Dreamweaver expects nothing.
Example
The following example of the documentEdited() function scans the document for layers and
updates a text field that displays the number of layers in the document:
function documentEdited(){
/* create a list of all the layers in the document */
var theDOM = dw.getDocumentDOM();
var layersInDoc = theDOM.getElementsByTagName("layer");
var layerCount = layersInDoc.length;
/* update the numOfLayers field with the new layer count */
document.theForm.numOfLayers.value = layerCount;
}
NOTE
Define the documentEdited() function only if you require it because its existence
impacts performance.
Przeglądanie stron 297
1 2 ... 293 294 295 296 297 298 299 300 301 302 303 ... 503 504

Komentarze do niniejszej Instrukcji

Brak uwag