Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Still trouble with var url onClick...

Posted on 1998-02-18
5
Medium Priority
?
410 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 100 total points
ID: 1278357
Impossible!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

972 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