Showing 179 scripts

Sort by name or size

Cruiser Behaviours

Cruiser Behaviours

Our Behaviors library was originally inspired by Ben Nolan’s Behaviours library. Basically, the idea is to use CSS selectors to “decorate” DOM elements with Javascript handlers and the like. We took the idea a step farther and pulled them out into a separate file, called a behaviors stylesheet (BSS). This is a stylesheet, using the same syntax as CSS, that includes a variety of attributes to support DOM decoration. For example, you can add a mouseover handler to show a preview window for all links marked with the preview class like this:

a.preview { mouseover: preview; }
You can also include traditional CSS elements, so if you want, you can simply add you BSS attributes to your existing CSS. This is no longer the case. Our implementation of this feature was somewhat flawed; we may re-introduce it in a future release, but for now, it has been removed. You can load an BSS file pretty much the same way you load an CSS file: with a link tag. The benefit of using BSS is two-fold: * Your Javascript can now focus more or less on the interfaces you want your DOM elements to support. You don’t need to clutter up your Javascript with the mappings between elements and methods / functions. * You can push out design-centric Javascript to the designer. In the ‘preview’ example above, you can let the CSS designer decide which links should provide a preview, rather than embedding that in your Javascript.
Cruiser Behaviours
Dan Yoder
57 KB
Last modified:
event, modal, rating, tabs, window
(4/5 from 1 vote)
Your rating:
Please sign in or register to rate this script
Select multiple tags with Ctrl+click (Cmd+click on Mac)

Found a bug or have a suggestion?Let us know

bitsonnet corp · © 2007-2014 · all rights reserved

Sign In / Register / Forgot password