Web Analytics Made Easy -
StatCounter JQuery - Resizing all images depending on their original size. - CodingForum

Announcement

Collapse
No announcement yet.

JQuery - Resizing all images depending on their original size.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolved 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; Apr 6, 2009, 11:30 AM. Reason: Figured out myself.

  • #2
    As this involves JQuery I suggest that you ask a mod to move this over to the Javascript frameworks forum.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

    Comment


    • #3
      Cheers Philip.
      Moved by user request.
      Blog | Twitter
      Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
      CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
      Remember: no link, no code, no help!

      Comment

      Working...
      X