The Next and Previous Buttons

Learn how to change headlines in the headline-linking script.

provided by: 
Originally published at Internet.com


Hola...

Now it gets hard to describe what's going on because the script is written to have multiple functions interact. So read closely and I apologize for any confusion I'll probably start up.

The Script's Effects

-----------------------------------

Here's the Code

When you click on either the next or previous headline buttons, you enact a function. Those functions look like this:

function chngNext() { document.headline.shownext.value = "Y" headMach(); } function chngPrev() { document.headline.showprev.value = "Y" headMach(); }

Let's say you click on "Next Headline". The function chngNext() fires and the value of one of the hidden fields, "shownext", has its value changed from "N" to "Y".

Then another function, named headMach(), is enacted.

The function chngPrev() runs if the "Previous Headline" button is clicked. It works the same way. The hidden field "showprev" is changed from "N" to "Y" and that headMach() runs.

...but's what's headMach()?

Why, this is headMach():

function headMach() { var totalHeads = 4; //total number of headlines you want if ((document.headline.shownext.value == "Y") && (document.headline.showprev.value == "N")) { var headShow= (parseInt(document.headline.nowShowing.value) +1); if (headShow > totalHeads) { var headShow = 1;} } if ((document.headline.showprev.value == "Y") && (document.headline.shownext.value == "N")) { var headShow= (parseInt(document.headline.nowShowing.value) - 1); if (headShow < 1) { var headShow = totalHeads;} } ...

Read article at Internet.com site
Regional Articles
- The Next and Previous Buttons Alabama
- The Next and Previous Buttons Alaska
- The Next and Previous Buttons Arizona
- The Next and Previous Buttons Arkansas
- The Next and Previous Buttons California
- The Next and Previous Buttons Colorado
- The Next and Previous Buttons Connecticut
- The Next and Previous Buttons DC
- The Next and Previous Buttons Delaware
- The Next and Previous Buttons Florida
- The Next and Previous Buttons Georgia
- The Next and Previous Buttons Hawaii
- The Next and Previous Buttons Idaho
- The Next and Previous Buttons Illinois
- The Next and Previous Buttons Indiana
- The Next and Previous Buttons Iowa
- The Next and Previous Buttons Kansas
- The Next and Previous Buttons Kentucky
- The Next and Previous Buttons Louisiana
- The Next and Previous Buttons Maine
- The Next and Previous Buttons Maryland
- The Next and Previous Buttons Massachusetts
- The Next and Previous Buttons Michigan
- The Next and Previous Buttons Minnesota
- The Next and Previous Buttons Mississippi
- The Next and Previous Buttons Missouri
- The Next and Previous Buttons Montana
- The Next and Previous Buttons Nebraska
- The Next and Previous Buttons Nevada
- The Next and Previous Buttons New Hampshire
- The Next and Previous Buttons New Jersey
- The Next and Previous Buttons New Mexico
- The Next and Previous Buttons New York
- The Next and Previous Buttons North Carolina
- The Next and Previous Buttons North Dakota
- The Next and Previous Buttons Ohio
- The Next and Previous Buttons Oklahoma
- The Next and Previous Buttons Oregon
- The Next and Previous Buttons Pennsylvania
- The Next and Previous Buttons Rhode Island
- The Next and Previous Buttons South Carolina
- The Next and Previous Buttons South Dakota
- The Next and Previous Buttons Tennessee
- The Next and Previous Buttons Texas
- The Next and Previous Buttons Utah
- The Next and Previous Buttons Vermont
- The Next and Previous Buttons Virginia
- The Next and Previous Buttons Washington
- The Next and Previous Buttons West Virginia
- The Next and Previous Buttons Wisconsin
- The Next and Previous Buttons Wyoming

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML