Operation Manual

Table Of Contents
333
Page content and assets
Last updated 11/30/2015
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.
There are special requirements for editing the behaviors in library items. Library items cannot contain style sheets,
because the code for those elements is part of the head section.
More Help topics
About Dreamweaver templates
Edit a behavior in a library item
Working with library items
Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the
options described in this article in Dreamweaver CC and later. For more information, see
this article.
Create a library item
Library items are elements that you want to reuse or update frequently throughout your website.
Create a library item based on a selection
1 In the Document window, select a portion of a document to save as a library item.
2 Do one of the following:
Drag the selection into the Library category .
Click the New Library Item button at the bottom of the Library category.
Select Modify > Library > Add Object To Library.
3 Type a name for the new library item, then press Enter (Windows) or Return (Macintosh).
Dreamweaver saves each library item as a separate file (with the file extension .lbi) in the Library folder of the sites
local root folder.
Create an empty library item
1 Make sure nothing is selected in the Document window.
If something is selected, it will be placed in the new library item.
2 In the Assets panel, select the Library category .
3 Click the New Library Item button at the bottom of the panel.
4 While the item is still selected, enter a name for it, then press Enter (Windows) or Return (Macintosh).