dropJ is a jQuery plugin to add drop caps—large floated initial capital letters—to (X)HTML content. dropJ is easy to use, just like jQuery, portable, working purely on text, robust, with targeted currying to find the right character(s) to make into a drop cap, and universal, working on languages which are usually displayed in utf-8 text like Chinese.
Project pages: in Google Code, on jQuery.com.
Download: jquery.dropj.js (most recent version is almost always what you want).
Features that are grayed out are either highly experimental or being considered for future release. Arguments are listed after attributes. Arguments in bold are the default.
opacity:0.7 // Big chars appear darker. ,float:"left" // Other text should flow around it. ,fontStyle:"normal" // Italics would be bad here. ,fontWeight:"bold" // Bold will be good. ,overflow:"visible" // Bottom margin can clip. ,textDecoration:"none" // When drop cap is a link.
toUpperCase()
on the drop cap.Ashley Pond V · ashley at cpan · org.
dropJ. Your jQuery drop cap plugin. The “d” in “dropJ” should be a capital “D” drop cap.
“Proceres mei et vos populi deputati, cum bellum Britannicum instituissem per locumtenentem meum gerendum, allocutus sum vos per cancellarium meum.”
“Proceres mei et vos populi deputati, cum bellum Britannicum instituissem per locumtenentem meum gerendum, allocutus sum vos per cancellarium meum.”
由于危害太大,我一直都不太敢发布,相信国内也有人知道的。只是不公开而已。经过再三考虑还是决定发布了,希望大家掌握了以后,不要对国内的站点做任何具有破坏性的操作。谢谢合作!
뿌리가 깊은 나무는 / 바람에도 흔들리지 아니하므로 / 꽃이 좋고 / 열매도 많으니. / 샘이 깊은 물은 / 뭄에도 그치지 않고 솟아나므로, / 내가 되어서 / 바다에 이르니.
Þá steig Drottinn niður til þess að sjá borgina og turninn, sem mannanna synir voru að byggja.
或日の暮方の事である。一人の下人が、羅生門の下で雨やみを待っていた。
jQuery, starts with a lowercase letter and we’d usually prefer to respect that.
¿Que pajo? Mi gusta: «Retirado en la paz de estos desiertos, con pocos pero doctos libros juntos, vivo en conversacion con los difuntos y escucho con mis ojos a los muertos.»
由于危害太大,我一直都不太敢发布,相信国内也有人知道的。只是不公开而已。经过再三考虑还是决定发布了,希望大家掌握了以后,不要对国内的站点做任何具有破坏性的操作。谢谢合作!
由于危害太大,我一直都不太敢发布,相信国内也有人知道的。只是不公开而已。经过再三考虑还是决定发布了,希望大家掌握了以后,不要对国内的站点做任何具有破坏性的操作。谢谢合作!
A Fox one day thought of a plan to amuse himself at the expense of a Stork, at whose odd appearance he was always laughing.
A Fox one day thought of a plan to amuse himself at the expense of a Stork, at whose odd appearance he was always laughing.
My, my, what a nice test of such a nice plugin for such a great library. This has the factor set to true.
My, my, what a nice test of such a nice plugin for such a great library. This has the factor set to true.
My, my, what a nice test of such a nice plugin for such a great library. This has the factor set to true.
My, my, what a nice test of such a nice plugin for such a great library. This has the factor set to true.
<script src="/local/path/to/jquery.js" type="text/javascript"></script> <script src="/local/path/to/jquery.dropj.js" type="text/javascript"></script> <script type="text/javascript">//<![CDATA[ jQuery(function($){ $("p:first").dropJ(); }); //]]></script>
<p style="line-height:15px; width: 50%;">
You will always get a decent drop cap from <b>dropJ</b> but you get the most predictable and best aligned drop caps when your line height is well defined in your CSS hierarchy.
</p>
$("p:first").dropJ();
You will always get a decent drop cap from dropJ but you get the most predictable and best aligned drop caps when your line height is well defined in your CSS hierarchy.
There are no known bugs but that is not particularly meaningful because I’m not currently testing on IE. I am extremely grateful for any feedback, suggestions, screenshots of problems if you find any. Please be as specific as possible with reports and include the code you are trying to run along with a description or screenshot of the problem. You can get me here—ashley at cpan · org.
0.0.1–0.0.3 are completely broken in IE (6 and 7 at least). IE refuses to mix units like ems and pixels under the covers. This is semi-fixed in 0.0.4 though, as usual, IE still looks pretty crappy and I'm not sure how well the utf8 stuff is working.
try
blocks with reporting.overflow
value into the defaults.