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

need NS4.7 support for image visibility and mouseover

Status
Not open for further replies.

RobV

Programmer
Feb 8, 2001
66
NL
I've got a page which displays a table with some image buttons inside. Next, I have a script inside that page which should hide/show each of these images.

(Actually, the are mouseovers in a table which should be enabled/disabled). The problem is that I cannot get it to work stable on NS4.7 (IE is no problem whatsover). I know that I should stop supporting NS4 and go for NS6 or something, but I am under boss-pressure here.

Code:
<td>
<div name=layLink id=layLink style=&quot;position:relative; left:0; top:0; visibility: hidden&quot;>
<a href=&quot;Javascript:DoButtonAction(1); onMouseOver=&quot;ImageOn('Link');&quot; onMouseOut=&quot;ImageOff('Link')&quot;>
<IMG src=&quot;button.gif&quot; id=&quot;Link&quot; name=&quot;Link&quot; border=&quot;0&quot; alt=&quot;&quot;>
</a>
</div>
</td>

I need the layer in order to hide/show the image, but I cannot get the mouseover to work. And even if I hide the image, the hyperlink is still clickable.

Help please?
 
Well - I don't know about that, I think it still depends on your client demographic, and although I agree with jaredn in principle, you still don't want to lose a large chunk of users if they are still runnung it. It's no big deal to support all three for a while.

It may be the code you are using to peform the hiding - the syntax for NN4 is:
doucument.layers.layLink.visibility ='hidden';


There is no style attribute.Otherwise it should bw working. Another problem may be the fact that you are using a positioned element inside a table - try it as an element on its own, then if that works start trying to get it inside the cell.

Also, when are you hiding the image/link? Like, when is it visible? &quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
I agree on whether to supporting NS or not.

The problem was/is that the image had to be inside a layer, in order for NS4 to make it visible/invisible, but when it is inside a layer there was no way to change the .src attribute of the image. Furthermore, it had to be a 'relative' layer, because the image had to be aligned to the right side of the window.

I finally figured it out by now, by making the div absolute and manually calculate the correct position. This way, IE and NS4 can hide/show it, change the .src of the image, and disable the anchor. Unfortunately, there had to be some extra code to recalculate the positions for each DIV on a resize.

Another lesson learnt: Design for NetScape 4, it'll probably work in IE anyway..

(By the way, if anybody has more tips on this subject, let me know)
 
Of course it will. That's why our code checks for the different browsers and does document.all(..) for IE or document.layers for NS4.. But that wasn't the problem..
 
No, my mistake. I said it wrong. I was trying to say that you should design your solution in NS, and make your adjustments to have it work in IE, not the other way around.
 
I agree, definetly. That's if you choose to support Netscape 4.X. I think everyone knows how I feel about that (ditch NS4). But if you must support it; do as Rob says, because everything is soooooo much easier to implement in IE :) jared@aauser.com -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top