1 Replies - 2618 Views - Last Post: 02 November 2012 - 03:27 AM

#1 Xavuse  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-August 12

Split text in automatic pages

Posted 19 August 2012 - 05:12 AM

Hi everyone.
After searching for an answer to my problem, Iím unable to find a solution. Iím a noob and I havenít got so much experience about Jquery.
Here is my problem:
I want to make a book app for smartphones and tablets. Iíve got a long text I want to place in multiple pages, but I want the app to generate this pages according to the lenght of the text and the screen size of the device. The text should full a page and automatically start a new page to continue. The page generation will continue until all text is placed on pages.
Does anyone know how to do it?

Thank You

Is This A Good Question/Topic? 0
  • +

Replies To: Split text in automatic pages

#2 Kruithne  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 99
  • View blog
  • Posts: 439
  • Joined: 28-July 09

Re: Split text in automatic pages

Posted 02 November 2012 - 03:27 AM

Hello Xavuse,

You appear to be asking a very large question and you've supplied no code yourself to show that you have attempted the issue. I do know myself how I might achieve said goal for an application but it would take too much time and effort to explain every intricate detail, so I shall point you in some directions.

Getting screen sizes
Use the .width() and .height() functions in conjunction with a jQuery wrapped $(window) object.

http://api.jquery.com/width/
http://api.jquery.com/height/

Splitting large chunks of text
The splice() and split() functions will help you tear up the text to the desired sizes.

http://www.w3schools...sref_splice.asp
http://www.w3schools...jsref_split.asp

Extras
The following two CSS properties might be of use to you also in this task.

http://www.w3schools...r_word-wrap.asp
http://www.w3schools...line-height.asp

Remember, we are here to help you, not to code for you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1