boldewyn / jquery.exdent Goto Github PK
View Code? Open in Web Editor NEWA jQuery plugin for hanging punctuation
Home Page: http://boldewyn.github.com/jQuery.exdent/
License: GNU General Public License v3.0
A jQuery plugin for hanging punctuation
Home Page: http://boldewyn.github.com/jQuery.exdent/
License: GNU General Public License v3.0
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 <blockquote> and <q> 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
tested in Chrome 15 and Safari 5.1
Opera 11.52 doesn't indent elements, that are not first children of their block parent.
position:relative could be used, but then we have a gap afterwards. And apart from that both start and end indenting might be near to impossible with it.
Currently we only exdent at the start. End indenting and indenting both sides should be there, too.
Seems not too problematic, when I tested it in Firebug. We have to figure out a useful API though.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.