Click to See Complete Forum and Search --> : need help with existing java script


technium
11-13-2003, 05:04 AM
I have the following Java Navigation Script for an internet site.

var myLinks = new

Array("../1/4_1.htm","index.htm","1_1.htm","1_2.htm","1_3.htm","1_4.htm","1_5.htm","1_6.htm","1_7.htm","2_1.htm","2_2.ht

m","2_3.htm","3_1.htm","3_2.htm","3_3.htm","3_4.htm","4_1.htm","../3/index.htm");

/*var thisPage = 0;

//alert(document.location.href.substring(document.location.href.lastIndexOf("\/") + 1 ));

for (var x = 0; x < myLinks.length; x++)
{

if (document.location.href.substring(document.location.href.lastIndexOf("\/") + 1) == myLinks[x])
{
thisPage = x;
break;
}

}*/

function selPage(myPage)
{
if (myPage < myLinks.length && myPage >= 0)
{
thisPage = myPage;
document.location.href = myLinks[thisPage];
}
}


temp = "<div style = 'position:absolute; left: 658; top: 72;'>"
+"<img src=\"../images/history.gif\" width=\"72\" height=\"13\">"
+"</div>"
+"<div style = 'position:absolute; left: 680; top: 85;'>"
+"<a href = \"#\" onMouseover = 'images[\"back\"].src = \"../images/history_back_over.gif\";' onMouseout =

'images[\"back\"].src = \"../images/history_back.gif\";'><img src=\"../images/history_back.gif\" id = 'back' name =

'back' width=\"12\" height=\"10\" alt = 'Go back to visited pages' onClick = 'window.history.go(-1)'></a>"
+"</div>"
+"<div style = 'position:absolute; left: 700; top: 85;'>"
+"<a href = \"#\" onMouseover = 'images[\"forward\"].src = \"../images/history_next_over.gif\";' onMouseout =

'images[\"forward\"].src = \"../images/history_next.gif\";'><img src=\"../images/history_next.gif\" id = 'forward' name

= 'forward' width=\"12\" height=\"10\" alt = 'Go forward to visited pages' onClick = 'window.history.go(+1)'></a>"
+"</div>"
+"<div style = 'position:absolute; left: 645; top: 385;'>"
+"<img src = 'nav_images/pm_back.gif' width = 27px height = 26 style = 'cursor:hand' alt = \"Return to the previous

page\" onClick = 'selPage(thisPage - 1)'>"
+"</div>"
+"<div style = 'position:absolute; left: 677; top: 385;'>"
+"<a href = \"index.htm\"><img src = 'nav_images/pm_main.gif' width = 20 height = 26 alt = 'Section Menu'></a>"
+"</div>"
+"<div style = 'position:absolute; left: 702; top: 385;'>"
+ "<img src='nav_images/pm_next.gif' width = 27 height = 26 border='0' alt = 'Go to the next page' style = 'cursor:hand'

onClick = 'selPage(thisPage + 1);'>"
+"</div>";

document.write(temp);

The problem is, Sections 3_1.htm to 3_5.htm are not needed so I deleted them from the directory and also tried deleting them from the bit at the top of this script but it no longer works, I also went through all the other pages and in the "This page =" bit I renumbered them to match but still no luck, any ideas please??

Thanks in advance

T

technium
11-13-2003, 07:22 AM
?