Dreamweaver Behaviors - Using JavaScript Behaviors
Tool(s) Required:
HTML Editor: Dreamweaver 4 or above
Recommended: Adobe Dreamweaver CS3
Adobe Dreamweaver helps non-programmers (and beginners) use certain in-built javascript functions that are useful to any web project. The code generated is very well optimized so you needn't worry about performance. The most Useful Behaviors are as follows:
- Check Browser
- Check Plug-in
- Go to URL
- Jump Menu - Click here to read our Tutorial
- Open Browser Window - Click here to read our Tutorial
- Play Sound - Click here to read our Tutorial
- Popup Message
- Preload Images
- Show Pop-Up Menu - Click here to read our Tutorial
- Swap Image/Swap Image Restore
- Validate Form
What is a Behavior?
A behavior is a combination of an event with an action triggered by that event. In the Behaviors panel, you add a behavior to a page by specifying an action and then specifying the event that triggers that action. Macromedia Dreamweaver MX 2004 behaviors place JavaScript code in documents to allow visitors to interact with a web page to change the page in various ways, or to cause certain tasks to be performed.
Note: Behavior code is client-side JavaScript code; that is, it runs in browsers, not on servers.
Events are, effectively, messages generated by browsers indicating that a visitor to your page has done something. For example, when a visitor moves the pointer over a link, the browser generates an onMouseOver event for that link; the browser then checks to see whether there's some JavaScript code (specified in the page being viewed) that the browser is supposed to call when that event is generated for that link. Different events are defined for different page elements; for example, in most browsers onMouseOver and onClick are events associated with links, whereas onLoad is an event associated with images and with the body section of the document.
An action consists of pre-written JavaScript code that performs a specific task, such as opening a browser window, showing or hiding a layer, playing a sound, or stopping a Macromedia Shockwave movie. The actions provided with Dreamweaver MX are carefully written by Dreamweaver engineers to provide maximum cross-browser compatibility.
After you attach a behavior to a page element, whenever the event you've specified occurs for that element, the browser calls the action (the JavaScript code) that you've associated with that event. (The events that you can use to trigger a given action vary from browser to browser.) For example, if you attach the Popup Message action to a link and specify that it will be triggered by the onMouseOver event, then whenever someone points to that link with the mouse pointer in the browser, your message pops up in a dialog box.
A single event can trigger several different actions, and you can specify the order in which those actions occur.
Continue reading about how to use behaviors by checking out the links to the specific behaviors's tutorial in the list above.
Absolutely FREE Web Templates
Check out these quality free web templates and download them without any registration or sign-up!
FREE Flash Actionscript & Animation Guide
Learn Flash the easy way using these easy-to-follow tutorials! Get your basics right or learn advanced flash actionscript!
Quality Dreamweaver Templates
Professional quality dreamweaver templates in over 20 categories, starting at just $9.95! Instant download & easy customization
This page is part of the SmartWebby's Free Web Design Guide, a collection of free web design tutorials, articles, tips and guidelines on effective web site design. From web design tips, techniques and ideas to HTML, CSS Styles, Fireworks and Dreamweaver tutorials you'll find all you need to know about web design right here!
SmartWebby.com is the web design flagship website of Jandus Technologies, a global provider of 'smart, innovative & fresh' best web design and rapid web programming services - highly professional, of top quality and globally affordable. Operational since January 2001, we have successfully built professional web sites for clients from all over the world (USA, UK, Canada, Australia, India, Greece, Denmark, Singapore, etc.). By creating attractive low-cost web designs that are W3C standard compliant, load-time and search engine optimized, we beat our competitors hands down comprehensively - in value, time and pricing. We specialize in Rapid SEO Web Design using Adobe Tools; W3C compliant tableless CSS & HTML/XHTML programming; Rapid ASP.net, AJAX, ASP and PHP web programming for database driven web sites and ecommerce web design; Quality Logo Design, Flash Animation and Interactive Flash Programming. No matter what your requirements are, our team of highly trained experienced web designers is capable of delivering a website that's over & above your expectations. Write to us for your free web design quote today! Also check out our Custom Web Design Packages and Professional Dreamweaver Templates for easy DIY websites templates.