Skip to content

Instantly share code, notes, and snippets.

@yobud
Created September 22, 2011 15:41
Show Gist options
  • Save yobud/1235092 to your computer and use it in GitHub Desktop.
Save yobud/1235092 to your computer and use it in GitHub Desktop.
$(function() {
$('p').each(function() {
var indent = 10; // pixel indent
var lineHeight = 14;
var nblines = $(this).height()/lineHeight;
$(this).width($(this).width()+nblines*indent);
for(var i=0; i < nblines; i++) {
$(this).prepend("<div style='float:right; clear:both; width:"+(i*indent)+"px; height: "+lineHeight+"px;'></div><div style='float:left; width:"+((nblines-i)*indent)+"px; height: "+lineHeight+"px;'></div>");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment