Guest User

Untitled

a guest
Jun 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $(document).ready(function() {
  2.  
  3. $(".entry-title a").lettering();
  4.  
  5. $.fn.stripTags = function() { return this.replaceWith( this.html().replace(/<\/?[^>]+>/gi, '') ); };
  6. $("span").each(function(i, el) {
  7. var html = $(el).html().replace(/\s+/, "");
  8. if ($(el).is(":empty") || html.length == 0)
  9. $(el).stripTags();
  10. });
  11.  
  12. var c = [ 'grey','green','blue','lightBlue','orange', 'red' ];
  13. $(".entry-title a span").randomClass( c, { randomness: 'successive', removeClasses: true } );
  14.  
  15. $(".entry-title").each(function () {
  16. var charLength = $(this).text().length;
  17. if (charLength >= 1) $(this).css({'font-size' : '100px', 'line-height' : '70px'});
  18. if (charLength >= 9) $(this).css({'font-size' : '95px', 'line-height' : '65px'});
  19. if (charLength >= 11) $(this).css({'font-size' : '90px', 'line-height' : '60px'});
  20. if (charLength >= 13) $(this).css({'font-size' : '85px', 'line-height' : '55px'});
  21. });
  22.  
  23. });
Add Comment
Please, Sign In to add comment