Web Analytics Made Easy -
StatCounter Using Javascript to Resize an Image - CodingForum

Announcement

Collapse
No announcement yet.

Using Javascript to Resize an Image

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

  • Using Javascript to Resize an Image

    Hey guys, I need help!

    Basically I have a site that allows people to upload images, simple enough. The thing is, when displaying these images I want them to be as uniform as possible without going out of scale.

    Basically what I'm looking for is a script that can output an image to scale within a certain constrained area. For example...if i have an image 500px by 300px and I have only an area of 200px width to display it in, I would like to be able to display the image with this new width of 200px but without it going out of proportion.

    Can anyone help or know of a good script? I have seen many on resizing to browser windows or users resizing but all I want is a 'simple' way to just display them. I'm not asking to actually physically alter them but rather the appearnce on screen.

    Hope you can help me I'd be soooo greatful!!! Thanks.

  • #2
    Anyone at all? Sorry for bumping this but I've searched everywhere and I'm not too good with JavaScript - pretty sure it's plausable though. Thanks again

    Comment


    • #3
      No script needed

      Code:
      <img src="image.gif" style="[B]width:200px; height:auto;[/B]" alt="" />
      Glenn
      vBulletin Mods That Rock!

      Comment


      • #4
        Originally posted by glenngv
        Code:
        <img src="image.gif" style="[B]width:200px; height:auto;[/B]" alt="" />

        My god thank you!!

        I'm such a dumbass. I don't believe I didn't think of doing that, grrrr!! Haha.

        Thanks again!!! You deserve that award.

        Comment

        Working...
        X