User blog comment:DuoDynamo/Collapsible character boxes/@comment-9573-20140222115037

I have built possible code for your idea here, including a live example: http://htmlgraveyard.tumblr.com/

Important parts that do the magic boldened.

Edit: The code does not yet take care of image height, which is variable per individual page.