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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event handling in Netscape 2

Status
Not open for further replies.

tiramisu01

Programmer
Feb 11, 2000
19
SG
I just found out that onMouseOver event doesn't work with &lt;img&gt; tag in Netscape? Is this true?<br>
<br>
If so, besides &lt;a href&gt; what other tags handles event in Netscape?<br>
<br>
merci. 8)
 
Works ok for me. Sample:<br>
<br>
&lt;script language=&quot;JavaScript&quot;&gt;<br>
&lt;!--<br>
function MM_swapImgRestore() { //v2.0<br>
if (document.MM_swapImgData != null)<br>
for (var i=0; i&lt;(document.MM_swapImgData.length-1); i+=2)<br>
document.MM_swapImgData<i>.src = document.MM_swapImgData[i+1];<br>
}<br>
<br>
function MM_preloadImages() { //v2.0<br>
if (document.images) {<br>
var imgFiles = MM_preloadImages.arguments;<br>
if (document.preloadArray==null) document.preloadArray = new Array();<br>
var i = document.preloadArray.length;<br>
with (document) for (var j=0; j&lt;imgFiles.length; j++) if (imgFiles[j].charAt(0)!=&quot;#&quot;){<br>
preloadArray<i> = new Image;<br>
preloadArray[i++].src = imgFiles[j];<br>
} }<br>
}<br>
<br>
function MM_swapImage() { //v2.0<br>
var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;<br>
for (i=0; i &lt; (MM_swapImage.arguments.length-2); i+=3) {<br>
objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];<br>
if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ¦¦<br>
(objStr.indexOf('document.all[') ==0 && document.all ==null))<br>
objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);<br>
obj = eval(objStr);<br>
if (obj != null) {<br>
swapArray[j++] = obj;<br>
swapArray[j++] = (oldArray==null ¦¦ oldArray[j-1]!=obj)?obj.src:eek:ldArray[j];<br>
obj.src = MM_swapImage.arguments[i+2];<br>
} }<br>
document.MM_swapImgData = swapArray; //used for restore<br>
}<br>
//--&gt;<br>
&lt;/script&gt;<br>
<br>
<br>
&lt;a href=&quot;resume.htm&quot; target=&quot;_parent&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; OnMouseOver=&quot;MM_swapImage('parent.frames[0].document.Image2','parent.frames[0].document.Image2','/images/resume2-a.gif','#943299205166')&quot; target=&quot;content&quot;&gt;&lt;img name=&quot;Image2&quot; border=&quot;0&quot; src=&quot;images/resume2-i.gif&quot; width=&quot;94&quot; height=&quot;58&quot; alt=&quot;Resume&quot;&gt;&lt;/a&gt;<br>

 
<br>
Okie thanx. So that would be links and layers. <br>
Will work round that.<br>
What a chore to have to take care of THE 2 browsers.
 
I usually just use <i>&lt;a href=# onMouseOver=&quot;whateverfuncion;return false;&quot;&gt;</i> in my pages; haven't had any problems on either of the 2 major browsers yet :) <p>-Robherc<br><a href=mailto:robherc@netzero.net>robherc@netzero.net</a><br><a href= shared.freeservers.com/searchmaster.html>SearchMaster Interface...11-in-1</a><br>Wanting to learn Assembler; please e-mail me any tutorials or links for it that are useful to you :)
 
Hmmm ... I have to use &lt;a href&gt; in order for my thingy to work with the 2 browsers, but I don't wanna do anything when I click on the link. I want it to just stay there, and do the image change for me. Any ideas? Thanx. 8)
 
Review the post &quot;Netscape - changing window contents etc.&quot; in the HTML/DHTML forum where that question is dealt with.
 
If I were you, I wouldn't do too much with layers. Netscape is dropping support for layers in V5.<br>
<br>
-nick bulka
 
OK.....add <i>onClick='return false;'</i> to your href tag; i.e. <i>&lt;a href=# onMouseOver='whateverfuncion;return false;' onClick='return false;'&gt;</i> <p>-Robherc<br><a href=mailto:robherc@netzero.net>robherc@netzero.net</a><br><a href= shared.freeservers.com/searchmaster.html>SearchMaster Interface...11-in-1</a><br>Wanting to learn Assembler; please e-mail me any tutorials or links for it that are useful to you :)
 
Netscape is dropping support for the proprietary &lt;LAYER&gt; tag. It is most decidedly not dropping support for standard DHTML layers such as the &lt;DIV&gt; tag. Actually Netscape 5 will be the first browser to fully support CSS positioning as specified by the W3.<br>
<br>
Personally I'm hoping Netscape will finally leapfrog back over IE as a web development platform, because even though IE has a lot of great features, it's documentation and general implementation tends to be less organized than Netscape's approach. Compare the MSDN info to <A HREF=" TARGET="_new"> to see the difference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top