A simple floating panel example
293
Both
div
tags use the
style
attribute to specify the position (
absolute
), size (
width:422px
and
height:181px
), and default
visibility
setting (
visible
) of the floating panels. The
blanklayer
panel uses the
center
attribute and a series of break (
br
) tags to position the text
in the center of the panel. The
scriptlayer
panel creates a form with a single
textarea
to
display the selected JavaScript code. The
textarea
tag also specifies that when an
onBlur
event occurs, indicating that the selected code has changed, the
updateScript()
function is
called to write the changed text back to the document.
Writing the JavaScript code
The JavaScript code for the Script Editor consists of one floating panel function that
Dreamweaver calls,
selectionchanged()
, and one user-defined function,
updateScript().
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:
Script marker
Summary of Contents for DREAMWEAVER 8-EXTENDING DREAMWEAVER
Page 1: ...Extending Dreamweaver...
Page 8: ...8 Contents...
Page 14: ...14 Introduction...
Page 16: ......
Page 54: ...54 Customizing Dreamweaver...
Page 96: ...96 Customizing Code View...
Page 98: ......
Page 110: ...110 Extending Dreamweaver...
Page 138: ......
Page 166: ...166 Insert Bar Objects...
Page 180: ...180 Commands...
Page 248: ...248 Toolbars...
Page 260: ...260 Reports...
Page 278: ...278 Tag Libraries and Editors...
Page 288: ...288 Property Inspectors...
Page 378: ...378 Server Behaviors...
Page 398: ...398 Data Sources...
Page 432: ...432 Server Models...
Page 456: ...456 Data Translators...
Page 482: ......
Page 492: ...492 The Shared Folder...