Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 415
  • Last Modified:

Still trouble with var url onClick...

I've intended to use this script in my schools page..in the topp frame.
The page is still under construction...
http://www.fredly.fhs.no

<HTML>
<HEAD>



      <SCRIPT LANGUAGE="Javascript"><!--
      var IMAGE_COUNT=3;
      var SelectedImage=-1;
      
      var srcsOut = new Array(IMAGE_COUNT);
      var srcsOver = new Array(IMAGE_COUNT);
      var srcsClick = new Array(IMAGE_COUNT);
      var urls = new Array(IMAGE_COUNT);

      srcsOut[0] = "bg_ansa.jpg";
      srcsOut[1] = "bg_elev.jpg";
      srcsOut[2] = "bg_link.jpg";

      srcsOver[0] = "br_ansa.jpg";
      srcsOver[1] = "br_elev.jpg";
      srcsOver[2] = "br_link.jpg";

      srcsClick[0] = "brransa.jpg";
      srcsClick[1] = "brrelev.jpg";
      srcsClick[2] = "brrlink.jpg";

      urls[0]="fakta.htm"
      urls[1]="linker.htm"
      urls[2]="e-mail.htm"

      function doOver(which){
      if(SelectedImage!=which)document.images[which].src=
srcsOver[which];
      }

      function doOut(which){
      if(SelectedImage!=which)document.images[which].src=
srcsOut[which];
      }

      function doClick(which)
      {if(SelectedImage!=-1)document.images[SelectedImage].src=
srcsOut[SelectedImage];
      document.images[which].src=srcsClick[which];
      SelectedImage=which;
      top.window.main.location=urls[which];
      }
      //--></SCRIPT>

</HEAD>
<BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080>

      <A HREF="Javascript:void(doClick(0))"onMouseOver="doOver(0);
return true" onMouseOut="doOut(0)">
      <IMG SRC="bg_ansa.jpg" BORDER="0"></A>
      <A HREF="Javascript:void(doClick(1))"onMouseOver="doOver(1);
return true" onMouseOut="doOut(1)">
      <IMG SRC="bg_elev.jpg" BORDER="0"></A>
      <A HREF="Javascript:void(doClick(2))"onMouseOver="doOver(2);
return true" onMouseOut="doOut(2)">
      <IMG SRC="bg_link.jpg" BORDER="0"></A>

</BODY>
</HTML>

As u can see.. I want the topframe to be as an indicator so those who visit the page can see what page they are on..(if u understand) But what I also want is that the menu frame on the left can be used the same way on the same time. I want them to coordinate so that they show exactly what page u're on. How do I do that? Do I have to use images or can the same be done with text?
The script above works rather bad in Explorer 3.0.
And most of all I want the function to work in Explorer 3.0 as well as Netscape 3.0!!!
Please help me with examples and explanation!
0
radars
Asked:
radars
1 Solution
 
tecbuilderCommented:
MSIE 3.x cannot do what you want.  MSIE 3.x cannot change images on the fly.  As for your code it looks ok.  If you want things to look as if they were getting updated on the fly, then you will have to use images.  If you want text to change the frame would have to be reloaded/refreshed with the new text, unless you wanted to design your site with DHTML.  DHTML is only supported in the 4.x versions of Netscape and MSIE.
0
 
radarsAuthor Commented:
Not what I asked for!
How can I use the left menu together with the top menu?
0
 
rotiaCommented:
I've made it with applets.

I've made a Java Applet that works like a button, but it changes two frames, the body frame and the top frame, so when you click on the left side frame buttons you can change at the same time the contens of the 2 other frames.

And when u click on the top side frame, you can do the same.

0
 
radarsAuthor Commented:
I want an answer in Javascript not as a Java applet!
0
 
superquestionsCommented:
Impossible!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now