Created
September 22, 2011 15:41
-
-
Save yobud/1235092 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$(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