How to make a image get bigger when you hover over it without it being Pixelated

Discussion in 'PHP' started by Floydfrass, Oct 25, 2010.

  1. #1
    Want a script to make when i hover over some images it gets bigger then when i move the pointer it goes back to normal size without getting pixelated
     
    Floydfrass, Oct 25, 2010 IP
  2. kai555

    kai555 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi

    You will have to use a larger version of the image and make it appear smaller on the page. Then on the mouse over set it to the original size. that way it won't be pixelated.

    to change the image's size use css

     .someclassname {
       width:70%;
     }
      
     .someclassname:hover {
       width:100%;
     }
    Code (markup):
     
    kai555, Oct 25, 2010 IP
  3. Floydfrass

    Floydfrass Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks much will definitely try it
     
    Floydfrass, Oct 25, 2010 IP
  4. reli4nt

    reli4nt Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You either start with a larger image in the first place (1 image file) OR you can switch to the larger version of the image when you are zooming in (2 image files).
     
    reli4nt, Oct 26, 2010 IP
  5. kai555

    kai555 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Having two image files is unnecessary if you can just shrink the larger one. It's a waste of bandwidth and time if the browser has to download both images. shrinking an image has no loss of quality so it's fine to just have the larger one.
     
    kai555, Oct 26, 2010 IP
  6. reli4nt

    reli4nt Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That depends on the context. If the zoomed image is very large and users won't always be zooming then the thumbnail saves bandwidth and streamlines the page. If the zoomed in image is not very large and/or the zoom is always used then you are definitely right.
     
    reli4nt, Oct 26, 2010 IP
  7. kai555

    kai555 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ok I agree with that. :)
     
    kai555, Oct 26, 2010 IP
  8. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    you can do hover with php. use javascript or css.
     
    w47w47, Oct 26, 2010 IP