Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remembering the reader's place #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

asolove
Copy link

@asolove asolove commented Jan 14, 2011

Hi Craig,

I've enjoyed playing with Bibliotype the last few days. I was working on a project teaching people how to do advanced typesetting on the web, and BT is the perfect baseline. It resolves all the nebulous questions about fonts and sizes and provides a structure for exploring what I want to talk about, like typesetting annotations, critical apparatus, and structured hypertext.

I've added a bit of js that helps keep the reader's place.

  1. When you read some, close the window, and come back later, it remembers where you left off. This is appropriate for long-form reading and annoying in other cases.
  2. When you change the font size, it intelligently keeps your place. Prior to this change, if you were halfway through an article and changed to a larger font size, it lost your place and put you only a quarter of the way through.

Thanks again!

-Adam

@cmod
Copy link
Owner

cmod commented Jan 15, 2011

Hi Asolove — this looks awesome! I pulled to my local machine for testing but it looks like it's not quite remembering the right position. It sort of hops up a few pixels on each page reload. And it's not quite the same location on font-size changes either .. any ideas?

@asolove
Copy link
Author

asolove commented Jan 15, 2011

Yes, appears the iPad changes the body's height from reflowing content even after the dom is rendered. I've committed a fix that helps that in the case of reloading the page. When it comes to switching font sizes, ultimately using the page scroll percentage is a hack that won't ever be precise.

I think the right thing to do is add in something like the NYT has where each paragraph is assigned a unique, linkable id anchor. Then we could just grab the top on-screen dom element and keep that at the top of the window when reloading or changing font sizes. Is that something that belongs in Bibliotype or as a separate addition?

@cmod
Copy link
Owner

cmod commented Jan 17, 2011

Good question ... I think the paragraph numbering would have to happen in JS. If the numbering is dynamically generated on load, I think it could be a very good anchor point for maintaining position on size changes and reloads.

And sure, I think that would be a worthwhile addition to the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants