next/prev navigation question

wxdqz

New Member
hullo
got this nice little bit of code from this site and am trying to alter it slightly so i can use it. have changed the file names appropriately, but i think i need to edit as i don't use frames, so have taken the "parent.frames['body']." part off but don't know what to replace it with to get it to work, it works for 2 pages then dies on me (stops progressing) with no error, can anyone help? any help v much appreciated... (i realise this will be sooooo simple for most people here, so bare with me!)

<SCRIPT language=javascript type=text/javascript>
<!--
<!-- script created by : THeMaRTy -->
<!-- website: <!-- m --><a class="postlink" href="http://marty.excudo.net">http://marty.excudo.net</a><!-- m --> -->
var count=1;
// the array with the links
// you can add as many links as you like, as long as you keep the numbers succeeding
var link_array = new Array();
link_array[1] = 'main.html';
link_array[2] = 'twee.html';
link_array[3] = 'drie.html';
// skip fwd
function next()
{
if ((count + 1) >= link_array.length)
{
alert('That was the last page');
}
else
{
count = count + 1;
parent.frames['body'].document.location.href = link_array[count];
}
}
// skip back
function previous()
{
if ((count - 1) <= 0)
{
alert('This is the first page');
}
else
{
count = count - 1;
parent.frames['body'].document.location.href = link_array[count];
}
}
//-->
</SCRIPT>
 
Back
Top