• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 20. Reuse Items In Your Web Site Wi... > Using Behaviors and Styles in Librar...

Using Behaviors and Styles in Library Items

When you apply a Dreamweaver behavior to an object Dreamweaver inserts JavaScript in the <head> of the HTML document. A library item does not have a <head> section. So, what happens to the JavaScript when you drag an object into the Library palette that has a behavior applied to it? When a library item with an attached behavior gets inserted into a Web page, Dreamweaver cleverly inserts any necessary JavaScript into the <head> section of the Web page.

Caution

Problems arise if you want to change the behavior associated with a library item. You cannot use the Behavior inspector while editing a library item because only the event half of the behavior is present. To edit a behavior attached to a library item you must first detach the item, edit the behavior, and then recreate the library item. It's easier to instead be sure of how you want the library item to work before you put in the library!



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint