Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #3
    New Coder
    Join Date
    Feb 2010
    Location
    Manchester, UK
    Posts
    69
    Thanks
    0
    Thanked 13 Times in 13 Posts

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •