
Reusing Content with Templates and Libraries
401
Making library items editable in a document
If you’ve added a library item to your document and you want to edit the item
specifically for that page, you must break the link between the item in the
document and the library. Once you’ve made an instance of a library item
editable, that instance cannot be updated when the library item changes.
To make a library item editable:
1
Select a library item in the current document.
2
Click Detach from Original in the Property inspector.
The selected instance of the library item loses its highlighting (if you had
highlighting visible), and can no longer be updated when the original
library item changes.
Editing a behavior in a library item
When you create a library item that includes an element with a Dreamweaver
behavior attached to it, Dreamweaver copies the element and its event handler
(the attribute that specifies which event triggers the action (such as
onClick
,
onLoad
, or
onMouseOver
), and which action to call when the event occurs) to the
library item file. Dreamweaver does not copy the associated JavaScript functions
into the library item. Instead, when you insert the library item into a document,
Dreamweaver automatically inserts the appropriate JavaScript functions into the
head
section of that document (if they aren’t already there).
Note:
If you hand-code JavaScript (that is, if you create it without using Dreamweaver
behaviors), you can make it part of a library item if you use the Call JavaScript behavior to
execute the code. If you don’t use a Dreamweaver behavior to execute the code, the code
isn’t retained as part of the library item.
The JavaScript functions are not stored with the library item because they are
elements of the
head
section of the document, while library items can only
contain
body
elements. Thus, the Behaviors panel is unavailable when you are
editing a library item, because only part of the behavior code (the event handler)
is included in the library item. To edit a behavior in a library item, you must first
insert the item in a document, then make the item editable in that document.
After you’ve made the desired changes, you can re-create the library item,
replacing the item in the library with the edited item from your document.
For more information about behaviors, see “Using Behaviors” on page 435.
Содержание 38028779 - Macromedia Dreamweaver - Mac
Страница 1: ...macromedia Using Dreamweaver...
Страница 148: ...Chapter 4 148...
Страница 296: ...Chapter 12 296...
Страница 472: ...Chapter 18 472...
Страница 512: ...Chapter 21 512...
Страница 562: ...Appendix 562...