Solved

Still trouble with var url onClick...

Posted on 1998-02-18
5
338 Views
Last Modified: 2008-02-26
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
Comment
Question by:radars
5 Comments
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1278353
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
 

Author Comment

by:radars
ID: 1278354
Not what I asked for!
How can I use the left menu together with the top menu?
0
 

Expert Comment

by:rotia
ID: 1278355
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
 

Author Comment

by:radars
ID: 1278356
I want an answer in Javascript not as a Java applet!
0
 
LVL 1

Accepted Solution

by:
superquestions earned 50 total points
ID: 1278357
Impossible!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question