Created
August 18, 2011 06:06
-
-
Save waako/1153408 to your computer and use it in GitHub Desktop.
add break before @ symbol if email address is longer than n characters
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
/* Add a line break before the @ in email addresses if longer than n characters to help legibility and prevent widows */ | |
jQuery('.contact-information-box a.email:contains("@")').each(function() { | |
var getContent=$(this).text(); | |
if( $(this).text().length > 31) { | |
var newString=getContent.replace('@','<br />@'); | |
} | |
jQuery(this).html(newString); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment