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

Mouseover

Status
Not open for further replies.

rbvcbr

IS-IT--Management
Mar 4, 2007
58
US
Windows XP pro / Javascript

I have two images, 90x90 and 160x160 sizes.
I am looking for javascript mouseover code,
if I mouseover on 90x90 I want to see 160x160.

Not the same size as 90x90.
Any help please
Thanks,

 
Cory, I could be wrong, but I think he wants you to write it for him.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
this is why i keep disappearing from TT.

Word.


Not to toot my own horn, but I can't remember the last time I was #9 on the MVP list.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
I did the following javascript, but it changes the image size from 81 to 81, not 81 to 181.

I tried the other way around, putting bigImageSize 81 and
smallImageTo 81. Still not worked. Any help at this point.
Thanks,
*************
<html>
<title></title>
<head>
<script language="JavaScript">
image0 = new Image();
image0.src = "bigBlueCircle.png","width=181","height=181";
</script>
</head>
<body bgcolor="#FFFFFF">
<table align="center" cellspacing="0" cellpadding="0" >
<tr>
<td>
<a href="#" target="_blank" onmouseover="image0.src='bigBlueCircle.png';"
onmouseout="image0.src='smallBlueCircle.png';">
<img name="image0" src="smallBlueCircle.png" border=0 width=81 height=81></a>
</td>

</tr>
</table>

</body>
</html>
 
Just a hunch, but this might have something to do with it:

Code:
<img name="image0" src="smallBlueCircle.png" border=0 [!]width=81 height=81[/!]>

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
<img name="image0" src="smallBlueCircle.png" border=0 width=81 height=81>

Yes, you are right. I noticed it also.
This is where I am stuck,If I 0 the above width/height then no image shows up.
 
If I 0 the above width/height then no image shows up

If you give anything dimensions of 0x0 then of course they won't show up. Just a stab in the dark, but why not dynamically set the dimensions to match the new image? Sounds like that might work.

Another thing, this is incorrect syntax:
Code:
image0.src = "bigBlueCircle.png"[!],"width=181","height=181"[/!];

AFAIK, you can't change dimensions via the src property on an image.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Just a suggestion - take it for what it is worth - what happens when you leave off the width and height attributes of the <IMG> tag?

Einstein47
“Evil abounds when good men do nothing.“ - Nelson R.
[&#91;]Starbase47.com]
 
what happens when you leave off the width and height attributes of the <IMG> tag?

The site won't validate :p

Considering that (s)he's not wrapping the values for those attributes in quotes I'm pretty sure (s)he's not too worried about it anyway [lol]

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Pshaw - Validation is overrated - just ask most of the folks on this site. [noevil]

But other than that - I suppose you could just add the width and height to the mouseover script.

And about your being #9 - I'm sure it is just a temporary thing - I can't even believe that I'm #7 - I really don't deserve it [purpleface].

Einstein47
“Evil abounds when good men do nothing.“ - Nelson R.
[&#91;]Starbase47.com]
 
I'm sure it is just a temporary thing

Yeah, it was mostly just a joke for Cory. I've been pretty busy for the last month at work, and just haven't been on much to answer questions. The big board (full list) is the only one that really matters anyway [smile]

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Einstein said:
...Validation is overrated...
I'm guessing you don't do this stuff for a living!

Anyway, you are wrong, validation (or rather the lack of) is the cause of more than any other problem I address here. That's why I changed my .sig so radically a while back. It is not overrated - just ask most of the folks on this site the JS and HTML/CSS forums.

So just to summarise:
Me said:
(Web) Validation is the process of validating that your markup adheres to a (doctype) standard. Standards are required to ensure your markup presents and functions in the same way across current (and future) markup parsers (spiders etc) and browsers (that support the accepted web standards).

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top