-
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
-
-
Wait so what do you want really?
Like a small image that gets bigger when you click a button or something?
-
-
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
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks