Hello Dwindows
January 30th, 2007
A really basic "window" handler using scriptaculous.
It (almost) won't care about your markup, just a couple of restrictions:
- Your "windows" need to have the CSS class "window"
- If a window has buttons, they need to have the classes: "close" or "fold"
- If your windows have content, it needs to sit in an element with the class "content"
With content and buttons:
HTML:
-
<div id="window" class="window">
-
<div id="window_header">
-
<div id="window_close" class="close"></div>
-
<div id="window_min" class="fold"></div>
-
<span id="window_title">Window</span>
-
</div>
-
<span class="content" id="window_content">
-
Some content in the window.
-
The "window" is layed out by the #window-rules...
-
</span>
-
</div>
Just the window:
HTML:
-
<div id="blank" class="window"></div>
To create one, just create a new Dwindow instance like so:
JAVASCRIPT:
-
new Dwindow( 'window', {handle: 'window_header'} );
First parameter is the element ID and the second parameter is your normal scriptaculous Draggable options parameter
Check out the examples -> here
and get the script here -> here