开发者

html, css, javascript - ebook (text) reader

开发者 https://www.devze.com 2023-03-19 10:46 出处:网络
I\'m a newbie so be kind to me :) I have a large text that I\'m trying to present in html, I want the text to \'fill the screen\'s real-estate\' depending on the browser/device - mobile vs desktop -

I'm a newbie so be kind to me :)

I have a large text that I'm trying to present in html, I want the text to 'fill the screen's real-estate' depending on the browser/device - mobile vs desktop - if its going overboard then I want it to trunk the remaining text and present it in another html (i.e. next page). I've tried searching for pagination and whatnot, I'm using html,css,javascript.. and pretty new to all this :)

I do understand my question is probably vague, but even a small direction would help so much!

(Just to make t开发者_运维知识库hings clearer, I'm trying to build a javascript ebook reader that I can add public domain books in the future).


Here's what you have to do.

  1. Figure out a way to see if text is overflowing
  2. Chop off excess text
  3. Make a link that fills the content div with the leftover text
  4. Repeat recursively
  5. If you don't know what recursion is goto step 5 else +1


I think you are much better to just set the pages to a reasonable size with some white space at the top and bottom, then let users scroll, pan and zoom as they like. Some like to scroll so that the line they are reading is always near the top, others in the middle.

There is also a big difference in the number of lines displayed in portrait and landscape modes.

If presented in normal page size chunks in plain HTML, you don't need any script at all and your readers can control scrolling, zoom and orientation in the manner that suits them best.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号