Alex Rivera | Logout

jQuery/JavaScript - auto cut & format paragraphs depending on the browser's window height and width

Asked 2012-08-21T06:20:48.167
11

Let say I have a very long page of content consisting of multiple paragraphs which cannot be displayed in a single browser window with vertical scrollbar

<p>...very long sentence ...</p>
<p>...very long sentence ...</p>
<p>...very long sentence ...</p>
<p>...very long sentence ...</p>

So I want to cut the paragraphs and format them into multiple pages, e.g.

<!-- page 1 -->
<p>...very long sentence ...</p>
<p>...very long </p><!-- the ending p tag is automatic inserted since the following text cannot be displayed -->

<!-- page 2 -->
<p>sentence ...</p>
<p>...very long sentence ...</p>
<p>...very long sentence ...</p>

Are there any existing scripts for this purpose?

In the extreme case the paragraph might contain image, so each line might be variying in height.

Edit
Report

2 Answers

0

you can use jquery accordion control, if you have multiple paragaraphs than you should divide then in accordion, it will improve the readabilty and look of your page

Read more from here

answered 2012-08-24T05:09:07.710
0

try this jquery plugin jqPagination or jPaginate

answered 2012-08-31T05:10:20.100

Your Answer