posted 15 years ago
Hey guys, great forum.
So, question:
I'be been fiddling with frames.
I managed to get a function that changes the right frame page when I click on a link in the left one.
But I have to create a specific function for each page and assign it to each individual link on the list.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>frame 10</title>
<script language="JavaScript" type="text/javascript">
<!--
function change1()
{
parent.right_frame.location="page1.htm";
}
function change2()
{
parent.right_frame.location="page2.htm";
}
function change3()
{
parent.right_frame.location="page3.htm";
}
function change4()
{
parent.right_frame.location="page4.htm";
}
//-->
</script>
</head>
<body bgcolor="#ffffff" text="#000000">
<center>
Click the link below to change one frame.
<br />
<a href="javascript:change1()">change to page1</a><br />
<a href="javascript:change2()">change to page2</a><br />
<a href="javascript:change3()">change to page3</a><br />
<a href="javascript:change4()">change to page4</a><br />
</center>
Pagina Principal
</body>
</html>
See?
So, is there a way to capture the click as a variable or something, assign it to the change-page function and display it on the right frame?