here is the html:
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center" valign="middle">
<td width="10" class="pagestyle" onClick="pageNo(-1);" align="right">«</td>
<td id="pageNum" class="pagestyle">1/5</td>
<td width="10" class="pagestyle" onClick="pageNo(+1);" align="left">»</td>
</tr>
</table>
And here is the corrosponding javascript:
var page = 0;
function pageNo(off) {
if (((page + off) > -1) && ((page + off) < 6)) {
page = page + off;
parseRSS(page);
} else if ((page + off) === 6) {
page = 0;
parseRSS(page);
} else if ((page + off) === -1) {
page = 5;
parseRSS(page);
}
}
What this is supposed to do is start with page 1, which it does, and count up or down depending on the link clicked. However, when we get to page 5, I have to click twice to go back to page 1. What is causing the double-click behavior?