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
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    automatic photo resize from thumbnail to larger size

    What is the best way to build a web page that will automatically resize a 400x500(or whaterver) photo to a thumbnail version in my html page?

    I want to be able to upload only one file to the ftp site and not 2. Here is a diagram to better explain what I am after.

    http://home.cogeco.ca/~newbie/images/photo-gallery.gif

    Thanks

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    I found this link: http://www.xs4all.nl/~sbpoley/webmatters/resize.html

    Look inside the source code, I found these lines that can work for you:
    Code:
    document.images[imgElement].width = imgArr[n][imgwidth];
    document.images[imgElement].height= imgArr[n][imgheight];

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Place your thumbnail img tags in a div and then set the size for those thumbnails using css

    <style type="text/css">

    .thumbs img{
    width:100px;
    height:70px;
    }

    </style>

    <div class="thumbs">
    <img src="pic1.jpg">
    <img src="pic2.jpg">
    <img src="pic3.jpg">
    <img src="pic4.jpg">
    <img src="pic5.jpg">
    </div>
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

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