Well, I only said I was tired of dealing with the script, not finished. I like the way I have the buttons handled and wanted you to at least have a look at it. It is the way I would do it. Here's a way to do it as I believe you were describing - at the end of the second (last large) script, where it says 'var k=1', add this function so that it now looks like so:
Code:
var k=1
function controls(dir){
k=k+dir
jumptopage(k);
document.getElementById('next').style.visibility=document.getElementById('back').style.visibility='visible'
if (k>=Math.ceil(galleryarray.length/totalslots))
document.getElementById('next').style.visibility="hidden";
else if (k<=1)
document.getElementById('back').style.visibility="hidden";
}
</script>
And change the inputs' HTML to this:
HTML Code:
<input id="next" type="button" onclick="controls(1)" value="Next"> <span id="pageNum">Page 1</span>
<input id="back" style="visibility:hidden;" type="button" onclick="controls(-1)" value="Previous">
That's it!
Bookmarks