Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sounds to me like you just need to implement <a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html" rel="nofollow noreferrer"><code>$.scrollTo()</code></a>: I just worked-up the following concept using a single "Advance Forward" button (Note: You must have jQuery and the scrollTo plugin referenced:</p> <pre><code>&lt;button class="next"&gt;Next&lt;/button&gt; &lt;div id="pagination"&gt; &lt;p&gt;The House of Representatives shall be composed of Members chosen every second Year by the People of the several States, and the Electors in each State shall have the Qualifications requisite for Electors of the most numerous Branch of the State Legislature.&lt;/p&gt; &lt;p&gt;No Person shall be a Representative who shall not have attained to the Age of twenty five Years, and been seven Years a Citizen of the United States, and who shall not, when elected, be an Inhabitant of that State in which he shall be chosen.&lt;/p&gt; &lt;p&gt;(Representatives and direct Taxes shall be apportioned among the several States which may be included within this Union, according to their respective Numbers, which shall be determined by adding to the whole Number of free Persons, including those bound to Service for a Term of Years, and excluding Indians not taxed, three fifths of all other Persons.) (The previous sentence in parentheses was modified by the 14th Amendment, section 2.) The actual Enumeration shall be made within three Years after the first Meeting of the Congress of the United States, and within every subsequent Term of ten Years, in such Manner as they shall by Law direct. The Number of Representatives shall not exceed one for every thirty Thousand, but each State shall have at Least one Representative; and until such enumeration shall be made, the State of New Hampshire shall be entitled to chuse three, Massachusetts eight, Rhode Island and Providence Plantations one, Connecticut five, New York six, New Jersey four, Pennsylvania eight, Delaware one, Maryland six, Virginia ten, North Carolina five, South Carolina five and Georgia three.&lt;/p&gt; &lt;p&gt;When vacancies happen in the Representation from any State, the Executive Authority thereof shall issue Writs of Election to fill such Vacancies.&lt;/p&gt; &lt;p&gt;The House of Representatives shall chuse their Speaker and other Officers; and shall have the sole Power of Impeachment.&lt;/p&gt; &lt;/div&gt; </code></pre> <p>--</p> <pre><code>var numElmnts = $("#pagination p").length; var lastIndex = 0; $(".next").click(function(){ var nextIndex = (lastIndex &gt;= (numElmnts-1)) ? 0 : (lastIndex+1) ; var nextParag = $("#pagination p:eq("+nextIndex+")"); $("#pagination").animate({ height: $(nextParag).outerHeight() }, 800, "linear", function(){ $("#pagination").scrollTo(nextParag, 800); }); lastIndex = nextIndex; }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload