473,545 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help: swap Image Link works in IE but Not FF

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:
onMouseOver="Pr oduct_Link.href ='http://glasstoilets.co m/catalog/tank1-p-28.html';

and

this to the full size...

<a href="" name="Product_L ink"><img src="Files/images/300x216/PICT0876.jpg"
name="Main_Imag e" 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
scenario.

Any help is greatly appreciated.
pejo
------------------------------------------------------
"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
May 25 '07 #1
3 2001
PEJO wrote on 25 mei 2007 in comp.lang.javas cript:
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:
onMouseOver="Pr oduct_Link.href ='http://glasstoilets.co m/catalog/tank1-p
-28.html';

and

this to the full size...

<a href="" name="Product_L ink"><img
src="Files/images/300x216/PICT0876.jpg" name="Main_Imag e" 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 scenario.

Any help is greatly appreciated.
Try this first:

<img src="Files/images/300x216/PICT0876.jpg"
onMouseOver="th is.href='http://glasstoilets.co m/catalog/tank1-p-28.html'"
onmouseout="thi s.href='Files/images/300x216/PICT0876.jpg'"
>
=============== =======

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

Try:

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

<img src="Files/images/300x216/PICT0876.jpg"
onMouseOver=
"document.getEl ementById('Plnk ').href =
'http://glasstoilets.co m/catalog/tank1-p-28.html'"
>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 25 '07 #2
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="http://glasstoilets.co m/catalog/tank1-p-28.html"
onMouseOver="MM _swapImage('Bas s_model_s','',' Files/images/70x50/Bass_model.jpg' ,1);MM_swapImag e('Main_Image', '','Files/images/300x216/Bass_model.jpg' ,1)"><img
src="Files/images/70x50/Bass_model.jpg"
onMouseOver="do cument.getEleme ntById('Plnk'). href='http://glasstoilets.co m/catalog/tank1-p-28.html';"
name="Bass_mode l_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_Imag e" width="300"
height="216" id="Plnk">

pete.


"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
PEJO wrote on 25 mei 2007 in comp.lang.javas cript:
>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:
onMouseOver="P roduct_Link.hre f='http://glasstoilets.co m/catalog/tank1-p
-28.html';

and

this to the full size...

<a href="" name="Product_L ink"><img
src="Files/images/300x216/PICT0876.jpg" name="Main_Imag e" 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 scenario.

Any help is greatly appreciated.

Try this first:

<img src="Files/images/300x216/PICT0876.jpg"
onMouseOver="th is.href='http://glasstoilets.co m/catalog/tank1-p-28.html'"
onmouseout="thi s.href='Files/images/300x216/PICT0876.jpg'"
>>

=============== =======

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

Try:

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

<img src="Files/images/300x216/PICT0876.jpg"
onMouseOver=
"document.getEl ementById('Plnk ').href =
'http://glasstoilets.co m/catalog/tank1-p-28.html'"
>>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

May 28 '07 #3
PEJO wrote on 28 mei 2007 in comp.lang.javas cript:
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.
PLEASE do not toppost, but post under each part of the text you aree
reacting on.

here is the code I implemented as per your explanation.

for the thumbnail:

<a href="http://glasstoilets.co m/catalog/tank1-p-28.html"
onMouseOver="MM _swapImage('Bas s_model_s','',' Files/images/70x50/Bass_mo
MM_swapImage() what function is that?
del.jpg',1);MM_ swapImage('Main _Image','','Fil es/images/300x216/Bass_mod
el.jpg',1)"><im g src="Files/images/70x50/Bass_model.jpg"
onMouseOver="do cument.getEleme ntById('Plnk'). href='http://glasstoilets.
com/catalog/tank1-p-28.html';" name="Bass_mode l_s" border="0"
id="Bass_model_ s"></a>
So you have TWO onmouseovers over each other,
each changing some attribute of the other?

Why?

I do not even know what you want to accomplish.

Do you?

Why would you want to change an <ahref on mouseover, since you cannt
click it without first hoovering?
(The Debug popup points to an error in the above code.)
What is a "Debug popup"?
What error?
What line of code?

btw, why do you name an img that has a id?
here is what I have for the main image as well

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

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

<img
src='PICT0876.j pg'
id='Plnk'
>
<br><br>
<img
src='img1.jpg'
onMouseOver='do it(this);'
onClick= 'goThere();'
alt = 'Hover me or click me!'
>
<script type='text/javascript'>

function doit(x) {
x.src = 'img2.jpg';
x.style.cursor = 'pointer';
document.getEle mentById('Plnk' ).src =
'PICT0999999.jp g';
};

function goThere() {
location.href = 'http://cnn.com/';
};

</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6146
by: Randell D. | last post by:
Folks, I'm still learning javascript - I've invested in a couple of books and reading online as much as possible. I'm pretty sure what I am suggesting is possible though I'm trying to weigh up the faults that might go with the suggestion... all opinions welcome. My question: I have a list of links that go to pages that have a similar...
3
5166
by: Steve | last post by:
Hi, I have a nice little script that works well displaying images on my website. It's a script where if you clik a thumbnail image a pop up window opens that contains a larger version of the same image. What I would like to create is a link that can be clicked on to close the window that contains the larger image. This would make it easier...
1
1841
by: portraitmaker | last post by:
I found some drag and drop code on the web and modified it a little b taking out some of the stuff I didn't need. This sample allows you to drag an image in a table to another positio and swaps the images. Rather than just swap the images I would like t have it insert the image and move the other images down one position (or up) What would...
8
5486
by: OysterCracker | last post by:
Hi - I've previously used js to swap images on mouseover in a menu. I'm stumped on a different situation and would appreciate some advice. I would like to swap imageA to ImageB when I mouseover imageC. Also, swap imageA to ImageB when I mouseover a text link. How do I do those? Thanks, ~OC~
6
3177
by: Karl | last post by:
Hi, Ok so on a given page I have 4 text links: see it in black see it in blue see it in red see it in green using the standard swap image behavior, clicking on one of the above links
7
8284
by: KiwiBrian | last post by:
On a web page I have a graphic for a Shopping Cart Submit button. It is within a form and working fine. I would like to perform an image swap to an identical graphic of a different colour when I hover over the button. Can anyone show me how to do this, or point me to an implementation. My present code for the submit button is:- <input...
3
2676
by: steve.peticca | last post by:
Hi, My onmousevent fails to switch the large photo with one of the smaller images. To be frank, I'm extremely new to Javascript programming and as such, am trying to learn from other sites out there for sample code. I can't see to determine the error. first image. (all images have the same problem.)
3
2296
by: Stephen Torri | last post by:
Below is a class that is suppose to represent a segment of memory or a contents of a binary image (e.g. ELF executable). I have started to read Modern C++ Design and thought the best way to ensure I was understanding the chapter on policy classes was to attempt to apply them to my project. I understand the general concept of policies but I...
1
1073
by: irfankissa | last post by:
Hi to every one, I would like to ask if any one knows how to resize the picture with javascript. I have used the swap img within my page, and I would like the second img to be different size than the SRC img. The SRC image which I used is 30x30; the second picture which i inserted as a link is 250x250. The problem is that when I click on the...
0
7669
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7926
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7439
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5987
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.