Cruiser Behaviours is submitted!
Your script is now in the approval queue. After a quick review we will notify you of the script's status by email. If everything's alright, we'll publish your work to the site and rss feed. Otherwise, we'll send you the email explaining what seems questionable. In that case, reply to the email whenever we should review the script again.
Also, don't hesitate to discuss things if you feel that our reasons are unfair. We are real folk, and we don't like bureaucracy. : )
Thank you for your contribution!
1
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.
- Website:
-
Cruiser Behaviours
- Author:
-
Dan Yoder
- Size:
- 57 KB
- Last modified:
- 12/06/2007
- License:
-
MIT
- Tags:
- event, modal, rating, tabs, window
- Rating:
-
4
(4/5 from 1 vote)
- Your rating:
-
0
Not yet rated
- Please sign in or register to rate this script
- You can't rate your own script.