Help: swap Image Link works in IE but Not FF

Discussion in 'Javascript' started by PEJO, May 25, 2007.

  1. PEJO

    PEJO Guest

    I'm not much of a JS programmer so I used the the standard Macromedia swap
    image function for a disjointed rollover..which works
    fine.. no problem swapping the image with that code....

    but when I add the following to the onMouseOver to the thumbnail:


    this to the full size...

    <a href="" name="Product_Link"><img src="Files/images/300x216/PICT0876.jpg"
    name="Main_Image" width="300" height="216" id="PICT1204_l"> </a>

    It works fine in IE but not firefox... Meaning the images swap no problem in
    both but the link only works in IE. My searching tells me that I may have
    to use getElementById() but I'm not sure how to implement it in this

    Any help is greatly appreciated.


    "Before you criticize someone
    Walk a mile in their shoes
    Then when you do criticize them
    you'll be a mile away and
    Wearing their shoes"
    ---seen on a wall somewhere in London
    PEJO, May 25, 2007
    1. Advertisements

  2. PEJO

    Evertjan. Guest

    PEJO wrote on 25 mei 2007 in comp.lang.javascript:
    Try this first:

    <img src="Files/images/300x216/PICT0876.jpg"

    FF correctly does not use a element name as an object.


    <img src='' id="Plnk">

    <img src="Files/images/300x216/PICT0876.jpg"
    "document.getElementById('Plnk').href =
    Evertjan., May 25, 2007
    1. Advertisements

  3. PEJO

    PEJO Guest

    OK I've tried this.. I'm getting a JS error when I rollover the small image.
    It swaps the image but not the links.

    here is the code I implemented as per your explanation.

    for the thumbnail:

    <a href=""
    name="Bass_model_s" border="0" id="Bass_model_s"></a>

    (The Debug popup points to an error in the above code.)

    here is what I have for the main image as well

    <img src="Files/images/300x216/PICT0876.jpg" name="Main_Image" width="300"
    height="216" id="Plnk">

    PEJO, May 28, 2007
  4. PEJO

    Evertjan. Guest

    PEJO wrote on 28 mei 2007 in comp.lang.javascript:
    PLEASE do not toppost, but post under each part of the text you aree
    reacting on.

    MM_swapImage() what function is that?
    So you have TWO onmouseovers over each other,
    each changing some attribute of the other?


    I do not even know what you want to accomplish.

    Do you?

    What is a "Debug popup"?
    What error?
    What line of code?

    btw, why do you name an img that has a id?

    The best I can do for you is deleting all the code junk that is not
    part of the probem and show you this:

    onClick= 'goThere();'
    alt = 'Hover me or click me!'
    <script type='text/javascript'>

    function doit(x) {
    x.src = 'img2.jpg'; = 'pointer';
    document.getElementById('Plnk').src =

    function goThere() {
    location.href = '';

    Evertjan., May 28, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.