Created
July 18, 2014 16:25
-
-
Save peterhry/019372e1b4e0efaed11d to your computer and use it in GitHub Desktop.
jQuery Dropcaps - The CSS pseudo selector approach is too buggy. I’m using jQuery to wrap the first char in a style-able <span> instead.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
var p1 = $('.post-intro p').eq(0), | |
text = p1.text(); | |
p1.html('<span class="dropcap">' + text.substr(0,1) + '</span>' + text.substr(1)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment