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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onclick image size toggle

    hello friends I'm a newbie..

    I need a little help. Im using big images in my website. I want a javascript to toggle the image size from "Original size to fit with resolution of screen" and vice versa.


    It should be onclick function like this

    <img id="blahblah" src="myimage.jpg" onClick="resize();" />

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,694
    Thanks
    25
    Thanked 657 Times in 656 Posts
    It is better to use images that have a resolution of 72 pixels per inch. Make the conversion on your side first. Things at higher resolution just take longer to load, but does not give any better image on computer screen.

    onClick="resize();"
    Resolution is NOT size! If you want to use smaller picture (thumbnails), make them on your side or just use small height/width on image.


  •  

    Posting Permissions

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