[jQuery] Drop Cap help - how to remove a single character?

[jQuery] Drop Cap help - how to remove a single character?

<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi folks,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'm trying to convert a little drop cap thing that I had done in DOM scripting to jQuery. Adding the drop cap image has been incredibly easy, but I'm stumped on how to remove the single letter of text that the image is replacing. I'm sure this is really simple, but I'm just not getting it, so any help would be much appreciated.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here is what I have so far:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>function swap_letter() {</DIV><DIV>  var first_letter = $('#main-content p:first-child').text().charAt(0);  </DIV><DIV>  if (first_letter.length == 1) {     </DIV><DIV>    $('<img />')</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>.src('/images/alphabet/' + first_letter.toLowerCase() + '.gif')</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>.addClass('fancy-letter')</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>.prependTo($('#main-content p:first-child'));</DIV><DIV>  }</DIV><DIV>} </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>$(document).ready(function() {</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>swap_letter();</DIV><DIV>});</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You can see it almost working at <A href="http://test.learningjquery.com/dropcap.htm"> http://test.learningjquery.com/dropcap.htm</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Any other suggestions for improvement are also most welcome. By the way, after I get this working, I plan to write it up as a tutorial on learningjquery.com, so I'll give credit (with a link to your site, if you wish) to anyone who helps. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>thanks in advance,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Karl<BR><DIV><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><BR class="khtml-block-placeholder"></DIV><DIV>_______________________</DIV><DIV>Karl Swedberg</DIV><DIV>www.englishrules.com</DIV>www.learningjquery.com<BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></DIV></BODY></HTML>_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/