jQuery.exdent
A small jQuery plugin to enable hanging punctuation[1], an advanced typographic feature. Elements are only exdented, if they are at the beginning of a line. The plugin changes the boring
"Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut a sapien. Aliquam aliquet
purus molestie dolor. Integer quis eros ut
erat posuere dictum.
to this:
"Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut a sapien. Aliquam aliquet
purus molestie dolor. Integer quis eros ut
erat posuere dictum.
You can customize the plugin to fit your exdentation needs:
$('blockquote, q').exdent({
by: '.5em'
});
This exdents both
and by 0.5em. Apart from that you can use jQuery's CSS function to set exdentation:
$('q').css('exdent', '.5em');
See [2] for a demo and [3] for issues.
--
O p t i o n s :
jQuery.exdent understands these option parameters:
- by (String): the width by which to exdent, this is a positive value.
- detect (Boolean or String): whether to autodetect the exdentation width (will ignore "width"). If a string is given, this is used for detection, otherwise an english opening quote, U+201C.
- className (String): class to add to / remove from exdented elements.
--
Note: Don't confuse this with jQuery.extend. ;-)
--
[1] http://en.wikipedia.org/wiki/Hanging_punctuation [2] http://boldewyn.github.com/jQuery.exdent/ [3] https://github.com/Boldewyn/jQuery.exdent/issues