tags:

views:

475

answers:

4

Hi, i want to use page break in html that means the reader cannot scroll down further until he select a link for it.

<SPAN id=title><A name=BdToc_1 external=yes><h1 id="BookTitle" align="center"><font color="#B90000"><b>Choose Subject</b></font></h1>
</A>
</SPAN>
<p>
Contents....
</p>

I want a page break before and after this. Please help me

+1  A: 

It's not quite possible in HTML. You could try makeing something in Javascript, but anyone can dissable javascript.

Why would you want something like this?

Ikke
+5  A: 

Forgive me for pointing out the obvious, but page breaks are used to separate distinct pages. Each HTML document is a distinct "page". "select[ing] a link" traditionally loads a new page. So.... why don't you just load the next page when they click on this link?

Dan Dyer
+3  A: 

You can specify where page breaks occur using CSS properties page-break-after, page-break-before. Of course, this works only when printing the web page. As far as I know, these properties are correctly implemented in all major browsers including IE6+. Additionally, you can also state that page break should not occur inside an element using page-break-inside.

If you want paging per se, you need to have HTML for each page and interlink these pages. Or you can fetch contents of each page using AJAX dynamically, which of course involves scripting.

petr k.
A: 

You can use onscroll in javascript to control the scrolling. The onscroll event can determine the current position and there is a function to scroll up if the user is too far down.

Then, when the user clicks the link, you set a flag (scrollok=1). The onscroll checks the flag and now permits scrolling.

If you want to defeat people who have deactivated javascript, just make the content invisible until they click using stylesheets: visibility=none.

Then, when they click the link, you enable scrolling via the flag, and make the content visible.

If you don't know how to do these things, just leave a comment and I can be more precise.

Andrew Swift