Forum Moderators: open

Message Too Old, No Replies

simple netscape image swap in layer problem

         

BenG

2:28 pm on Jul 4, 2002 (gmt 0)

10+ Year Member



hi,
i was wondering why my image swap wasn't working in netscape, mozilla etc. then i came across document.layers, it still doesn't work though.....

code:
------------------------------------------------------------------------

function flip(name, src) {
swapImage='images/clients/'+src
document.layers['invjav'].document.images[name].src = swapImage
//alert(document.layers['invjav'].document.images[name].src)
}
------------------------------------------------------------------------
annoyingly when i do the alert it will load the image. Can anyone help with this please as its driving me nuts

martinibuster

3:23 pm on Jul 4, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



What's triggering the event? I found that Netscape 4.7 doesn't like the onmousedown but is very happy to cooperate with onClick. Just an idea.

BenG

3:35 pm on Jul 4, 2002 (gmt 0)

10+ Year Member



thanks for the post, should have posted that too really
<a href="#" onClick="flip('preload', 'invjav_pic.gif')">Investia Javelin</a> 
hope its not just a mac problem.

BenG

3:53 pm on Jul 4, 2002 (gmt 0)

10+ Year Member



Just had a thought:

would using an animated gif cause this problem?

BenG

10:16 am on Jul 5, 2002 (gmt 0)

10+ Year Member



after much searching it seems that animated gifs are a problem, but also using <a href="#" is also a problem as NN4 sees href as a link to another page - solution
<a href="javascript:void(0)" onClick="flip('preload', 'invjav_pic.gif', 'invjav'); return false">
thanks for the input anyway.
Ben