Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with frames and Javascript !!! 1

Status
Not open for further replies.

Vesku

Programmer
Jun 7, 2000
19
0
0
FI
Hi!

I have JS-code like this:



function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this = makeArray.arguments;
}

var SIJAINTI = 0;
var ProductsLinkit = &quot;&quot;;



var ProductsLinkit = new makeArray(&quot;

var products1 = new Image();
var products2 = new Image();
var products3 = new Image();
var products4 = new Image();
var products5 = new Image();
var products6 = new Image();

products1.src = &quot;images/ala_empty.gif&quot;;
products2.src = &quot;images/compounds_navi.gif&quot;;
products3.src = &quot;images/masterbatches_navi.gif&quot;;
products4.src = &quot;images/search_navi.gif&quot;;
products5.src = &quot;images/ala_empty.gif&quot;;
products6.src = &quot;images/ala_empty.gif&quot;;


function Products(nappi1,nappi2,nappi3,nappi4,nappi5,nappi6) {
eval(&quot;document['ala1'].src = &quot; + nappi1 + &quot;.src&quot;);
eval(&quot;document['ala2'].src = &quot; + nappi2 + &quot;.src&quot;);
eval(&quot;document['ala3'].src = &quot; + nappi3 + &quot;.src&quot;);
eval(&quot;document['ala4'].src = &quot; + nappi4 + &quot;.src&quot;);
eval(&quot;document['ala5'].src = &quot; + nappi5 + &quot;.src&quot;);
eval(&quot;document['ala6'].src = &quot; + nappi6 + &quot;.src&quot;);
SIJAINTI = 3;
}


function Linkki(osoite) {
if (SIJAINTI == 3) { top.teksti.document.location.href = ProductsLinkit[osoite]; }
}


--------------

Then i have HTML -code like this:

<a href=&quot;products.shtml&quot; onMouseOver=&quot;Products('products1','products2','products3','products4','products5','products6')&quot;><img src=&quot;images/products_navi.gif&quot; width=80 height=11 alt=&quot;&quot; border=&quot;0&quot; name=&quot;Products_nappi&quot;></a>

and

<a href=&quot;#&quot; onclick=&quot;return Linkki(3);&quot;><img src=&quot;images/ala_empty.gif&quot; width=80 height=10 alt=&quot;&quot; border=&quot;0&quot; name=&quot;ala4&quot;></a>


I have two frames and JS -navigation...That HTML is located in upper frame.

How can i make script, which works ???

Thx!
 
This is a sample page that would contain the navigation buttons.


<html>
<head>
<title>Untitled Document</title>
<script>

function LoadVars(){
if (navigator.appName == &quot;Netscape&quot;){
mainframe = parent.frames[0];
}
else{
mainframe= window;
}
}
function goBack()
{
mainframe.history.back();
}

function goForward()
{
mainframe.history.forward();
}

</script>

</head>
<body bgcolor=&quot;#FFFFFF&quot; onLoad=&quot;LoadVars()&quot;>
<br>
<br>

<br>
<a href=javascript:goBack();>back </a>-
<a href=javascript:goForward();>forward </a>-
</body>
</html>


Hope this helps Caspar Kennerdale
Senior Media Developer
 
This is a sample page that would contain the navigation buttons.

<code>
<html>
<head>
<title>Untitled Document</title>
<script>

function LoadVars(){
if (navigator.appName == &quot;Netscape&quot;){
mainframe = parent.frames[0];
}
else{
mainframe= window;
}
}
function goBack()
{
mainframe.history.back();
}

function goForward()
{
mainframe.history.forward();
}

</script>

</head>
<body bgcolor=&quot;#FFFFFF&quot; onLoad=&quot;LoadVars()&quot;>
<br>
<br>

<br>
<a href=javascript:goBack();>back </a>-
<a href=javascript:goForward();>forward </a>-
</body>
</html>
</code>

Hope this helps Caspar Kennerdale
Senior Media Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top