Results 1 to 3 of 3

Thread: Dynamcially Resize Images

  1. #1
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamcially Resize Images

    Hi,
    Is there a JavaScript code that resizes images automatically when the page loads? (I can't use CSS because the image is loaded directly from IPB so there is no class etc)
    (I know there is a mod for vBulletin which makes every image a thumbnail with the possibility to open it full size)

    Thanks

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Wait so what do you want really?
    Like a small image that gets bigger when you click a button or something?

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You can use the html properties of width and/or height (preferably width), those properties with css (either through a class or the style="" attribute), or you can use Javascript like you're doing. That's really all that can be done.

    If you want to deal with some more complex code and it seems needed (note also that this is a load on the server and may take a few moments to process, every time it loads), you can use the PHP GD image manipulation library, specifically open an image, resize using imagecopyresampled(), then output that image. Information is availble here:
    http://www.php.net/manual/en/ref.image.php

    Or, of course, you could just save the images to the proper size in the first place, even if that places two copies on your server-- that's probably easiest.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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