Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-25-2002, 04:37 PM   PM User | #1
nisav
New to the CF scene

 
Join Date: Jul 2002
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
nisav is an unknown quantity at this point
onMouseOver Image Rollovers

HI,
I am not very experienced with javascript and got stuck doing the following. I have placed some image rollovers on one of my pages..where when a user rolls over some text links..and image appropriate to that text is showen...when the mouse moves away from the links then a blank image is displayed as a place holder. this is all simple...here is where i am stuck. The place holder has a specific size...but the rest of the images that are displayed when the text is rolled over have different sizes, some are vertical some are hortizontal. i do not want to have to resize every image so that it properly fits the place holder...add the white borders and so on...so that the image is dispalyed properly.
Is there a way to have the size be changed for each image...so that the size doesnt get inherited from the place holder, but so that the script applies the size associated with each individual image.
example
place holder is 20 x 20
image 1 is 100 x 200
image 2 is 200 x 100
the place holder is loaded...when the mouse moves over the first link...image 1 replaces the place holder...but instead of taking on the size of 20x20 it has to be displayed at its own size of 100 x 200...
how can i do this?
thank you for all of your help
nisav is offline   Reply With Quote
Old 03-28-2010, 02:11 PM   PM User | #2
SwordOfBath
New to the CF scene

 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
SwordOfBath is an unknown quantity at this point
Cool OnMouseovere - How to switch 2 images

Good luck with that prob, maybe you could mail me when you get the answer! It's a very interesting question.

What I was looking for was a simple script That showed a pic on a button, then when moused over would change to a second pic.
Finally when clicked; I want it to follow a link

Any ideas?
SwordOfBath is offline   Reply With Quote
Old 03-29-2010, 03:25 PM   PM User | #3
flaMasta
New Coder

 
Join Date: Feb 2010
Location: Manchester, UK
Posts: 69
Thanks: 0
Thanked 13 Times in 13 Posts
flaMasta is an unknown quantity at this point
Some Solution

One solution would be not to replace your place holder but to show image over it, centered on the holder or aligned as needed.
Make position absolute, get the coordinates of your holder and set left (and) top of your image appropriately.

If you need some example code I could write it, tho time is of the essence
flaMasta is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:21 AM.


Advertisement
Log in to turn off these ads.