More to be added later.
To link the JESS library to your HTML document you need to link the core jess.js script, eventually followed by module-specific code (see below). jQuery framework must be loaded before the JESS library.
<head> <script type="text/javascript" src="js/jquery-1.3.min.js"></script> <script type="text/javascript" src="js/jess.min.js"></script> </head>
The styledBox module is made to easy create virtually any box style. The idea is to use a 9-sliced background image, put its corner slices to respective box corners, fill the box edges by repeating the edge slices, and fill the center part by repeating the central slice.

There must be both jQuery and JESS framework script code loaded. Then some box style can be defined (by calling the JE$$.styledBox() method, see below). Once there is a box style defined and the DOM of the document is ready, all HTML elements of the class "JESS-styledbox-id" (where "id" is ID of an existing box style) are automatically processed to use the proper style. Example:
<div class="JESS-styledbox-blueround"> ... </div>
JE$$.styledBox(options)JE$$.styledBoxReplace( string selector, string oldStyleID, string newStyleID)JE$$.styledBoxReplace('#menu.selected', 'greenwithshadow', 'bluewithbiggershadow');
JE$$.apply( 'styledBox', string styleID)'styledBox'. If styleID is set, only given style is applied, leave it empty to (re)apply all styles. This method may be useful i.e. when new boxes are dynamicaly added to the document and should be styled, or if the style should be re-applied for some reason.
JE$$.apply('styledBox');
There must be a folder containing those 9 slices. These are image files named 1.ext to 9.ext, where "ext" is the file extension (usually "png" or "jpg"). With this set of images, a box style must be defined.
Note: There will be an online service for creating slices and style definitions automatically. Since it's not available yet, coders have to create the slices and style definitions themselves, manually.
The style definition is a piece of Javascript code, the syntax is:
JE$$.styledBox(options);
where options is an object containing following keys:
idborder'1px solid green'
'1px solid black'
bgColor'#ccffe0'
'transparent'
img'img/styledboxes/blueround'
ext'jpg'
'png'
width{ top:5, right:10, bottom:15, left:10 }
minWidth40
0
minHeight40
0
padding'15px 40px 25px 20px'
'0'
order[9,8,7,6,4,3,2,1]
[1,2,3,4,5,6,7,8,9]
<head>
<script type="text/javascript" src="js/jquery-1.3.min.js"></script>
<script type="text/javascript" src="js/jess.min.js"></script>
<script type="text/javascript">
JE$$.styledBox({
id : 'blueround',
border: '1px solid blue',
bgColor : '#ccf',
img : 'img/blueround',
ext : 'png',
width : { top:10, right:10, bottom:10, left:10 },
padding : '15px 20px',
minHeight : 20,
minWidth : 20
});
</script>
</head>
<body>
...
<div class="JESS-styledbox-blueround"> ... </div>
...
However, this is the manual approach to styled boxes creating. Once the onlice service is ready and predefined styles are used, the example will look like this:
<head> <script type="text/javascript" src="js/jquery-1.3.min.js"></script> <script type="text/javascript" src="js/jess.min.js"></script> <script type="text/javascript" src="js/jess-defs.js"></script> </head> <body> ... <div class="JESS-styledbox-blueround"> ... </div> <div class="JESS-styledbox-greenwithshadow"> ... </div> ...
Any modern browser (IE7+, Gecko/FF, Safari/WebKit, Opera). IE6 and older are not supported, fallback style is applied here.