Archives for March 2008
You are currently browsing 4 article(s) published in March 2008, please try the search if you can't fint what you're looking for.
Numeric DLs jQuery Plug-in
Monday, March 31, 2008
This little plug-in will add numbers to definition-descriptions (<dd>) if there are more than one for a term (<dt>).
Take this code for example:
<dl>
<dt>Jug</dt>
<dd>A small pitcher.</dd>
<dd>Vulgar Slang. A woman's breasts.</dd>
<dt>Bird</dt>
<dd>The animal of the skies</dd>
</dl>
Using the plug-in (like so: $.numericDLs();) would result in the following output:
Jug
(1) A small pitcher.
(2) Vulgar Slang. A woman's breasts.
Bird
The animal of the skies
Perhaps this could be done with pure CSS? Counters and generated content perhaps..
You can as usual get the code from my Google Code repository. Have fun!
Update
Tobias mentions a CSS-solution in the comments and after some playing around I managed to make it identical to the JS-one:
dl dt {
counter-reset: i;
}
dl dd + dd,
dl dd ~ dd:not(:last-child) {
counter-increment: i;
}
dl dd + dd:before,
dl dd ~ dd:not(:last-child):before {
content: "(" counter(i) ") ";
}
Only real browsers though obviously.
- Comments are off
- Filed under Javascript, jQuery, Progressive Enhancement
jQuery Vibrate Plug-in
Thursday, March 27, 2008
This simple plug-in makes elements on the page vibrate.
I built it for a project at work and to be frank I think this sort of stuff is no better than the 90s blink-element but perhaps someone will find it useful.
Use it like:
$('#my-annoying-ad').vibrate();
Enjoy.... or not..
- Comments are off
- Filed under Javascript, jQuery
Console says: console is not defined
Wednesday, March 26, 2008
- Comments are off
- Filed under Funny Stuff, Other
Well done...
Thursday, March 06, 2008
...and cheers for listening!
- Comments are off
- Filed under Other







