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
    Regular Coder Apothem's Avatar
    Join Date
    Mar 2008
    Posts
    380
    Thanks
    36
    Thanked 25 Times in 25 Posts

    JQuery - Resizing all images depending on their original size.

    I'm not experience with JavaScript so sorry if I'm slow on this.

    So I want to use JQuery to:
    1. Locate all images from the div id #images.
    2. Check each image's size if it's over 800px.
    3. If an image size is over 800px, resize it to 800px.
    4. If an image size is over 800px, add a small text above it saying "This image has been resized!"
    5. If an image size is over 800px, add an onclick event so that the image can be returned to its original size OR if already at original size, resize back to 800px.

    What do I need to know to do this (or if it's too much of an explanation, paste the code that does all of this and I'll try to decrypt it...)
    Last edited by Apothem; 04-06-2009 at 04:30 PM. Reason: Figured out myself.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    As this involves JQuery I suggest that you ask a mod to move this over to the Javascript frameworks forum.

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Cheers Philip.
    Moved by user request.


  •  

    Posting Permissions

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