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!

Works in IE, does not work in NN.

Status
Not open for further replies.

Uttam

IS-IT--Management
Oct 2, 2000
7
0
0
US
This is the source of a webpage I am developing.

<html>
<head>
<title>Untitled</title>
</head>
<SCRIPT Language=&quot;JavaScript&quot;>
function SwapOut01() {
imageflipper1.src=&quot;imageflipper10.src=&quot;return true
}
function SwapBack01() {
imageflipper1.src=&quot;imageflipper10.src=&quot;return true
}
function load_2(country_code) {
var action_line1=&quot;/cgi/get_details.pl?country_code=&quot;;
action_line1 +=country_code ;
parent.Frame_No_2.location.href =action_line1;
var action_line2=&quot;/cgi/country_intro.pl?country_code=&quot;;
action_line2 +=country_code ;
parent.Frame_No_3.location.href =action_line2;

}
</script>

<body>
<A onmouseover=&quot;SwapOut01()&quot; onmouseout=&quot;SwapBack01('')&quot;>
<IMG BORDER = &quot;0&quot; NAME = &quot;imageflipper1&quot; SRC=&quot;</A>
<A onClick=&quot;return load_2('us')&quot; onMouseOver=&quot;SwapOut01()&quot; onMouseOut=&quot;SwapBack01()&quot;>
<IMG STYLE=&quot;position:absolute; left=90; top:22;&quot; BORDER = &quot;0&quot; NAME = &quot;imageflipper10&quot; SRC=&quot;</A>

</body>
</html>


To test out, replace 'mysite' with another site where the following image pics exist in 'images' subdirectory:

continent1.gif
i-continent.gif
zerobytes.gif (a 1x1 pixel dummy picture)
us.gif

----------------------------------
This works perfectly in Internet explorer.. especially the onmouseover and onmouseout events... but it does not work in Netscape Navigator.

What am I doing wrong? B-(

Thanks for all help

Regards,

Uttam
 
this might be a wild guess, but in your mouseover and out events, end the () with a semicolon;, NN can be very picky.

Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
tried that with &quot;;&quot; but did not work either.. Thanks for suggesting.

Can anyone think of something else I might be doing wrong?

By the way the site has something similar to what I am trying .. move your mouse over the extreme left list of departments and see a submenu pop up on the right, move the mouse on one of the submenu options and see another submenu pop up - exactly what I am trying to accomplish.. although I am going only 1 sub-level deep

Regards,

Uttam
 
While IE gives us complete control of items on an HTML page, Netscape is quite restrictive. On initial inspection of your code I notice you've hit one of those restrictions. The Anchor tag, <A> does not support onMouseOver(), onMouseOut(), and onClick() events. But they are supported if you provide a link (ie. an HREF).

On looking at your code, it looks like you do not want to provide a link, therefore a workaround is to provide a null URL (ie. HREF=&quot;&quot;), then cancel its default action by returning a false from your onClick event. Here's what I mean:

<A HREF=&quot;&quot;
onMouseOver=&quot;myMouseOver.gif&quot;
onMouseOut=&quot;myMouseOut.gif&quot;
onClick=&quot;myClickEvent(); return false&quot;>
</A>

Another way of coding the onClick is:
onclick=&quot;return myClickEvent()&quot;
But you MUST return a false from your myClickEvent().

Hope this helps.





Yogesh Pancholi

&quot;If a pig loses its voice, is it disgruntled?&quot;
 
Try <A HREF=&quot;#&quot; ...etc>, otherwise Netscape will try to refresh the page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top