Rotating images and different image dimensions

Discussion in 'Javascript' started by John, May 26, 2004.

  1. John

    John Guest

    I am rotating images at one location of my web site. My problem is if
    I set the width and height of the new image before I show the new
    image, the old image is stretched first to the new image dimensions,
    and if I show the new image before setting its dimensions, the new
    image is stretched first to the old image dimension before it is
    adjusted to its own dimension.
    I would like to load a new image with its own dimension at the same
    time. How can I do this?


    thank you
    John
    John, May 26, 2004
    #1
    1. Advertising

  2. John

    Lee Guest

    John said:
    >
    >I am rotating images at one location of my web site. My problem is if
    >I set the width and height of the new image before I show the new
    >image, the old image is stretched first to the new image dimensions,
    >and if I show the new image before setting its dimensions, the new
    >image is stretched first to the old image dimension before it is
    >adjusted to its own dimension.
    > I would like to load a new image with its own dimension at the same
    >time. How can I do this?


    Off the top of my head:

    1. change the image to something amorphous, change the dimensions,
    then change to your new image. The intermediate image could be
    a solid color (white?) or it could be some sort of swirl to give
    the impression of an image being rotated.

    2. change the visibility of the image to hidden, update it, then
    set it back to visible.

    3. rewrite the entire <img> tag with the new image and dimensions.

    Do all popular browsers allow you to change the dimensions of images
    on the fly these days? Some older ones wouldn't allow that.




    Do most current browsers allow you to change the dimensions of an
    image after it's been rendered? Some older browsers won't.
    Lee, May 27, 2004
    #2
    1. Advertising

  3. John

    Ivo Guest

    "John" wrote
    > I am rotating images at one location of my web site. My problem is if
    > I set the width and height of the new image before I show the new
    > image, the old image is stretched first to the new image dimensions,

    <snip>
    Can we see your current code (only the relevant bits, but all of them, and
    not exceeding 72(?) characters per line, with some indentation and perhaps a
    few well-chosen whitelines)? If not, any suggestion we make is as much to
    the point as anything you can read at dynamicdrive.com.

    The magic word is preload.
    HTH
    Ivo
    Ivo, May 27, 2004
    #3
  4. John

    John Guest

    Lee <> wrote in message news:<>...
    > John said:
    > >
    > >I am rotating images at one location of my web site. My problem is if
    > >I set the width and height of the new image before I show the new
    > >image, the old image is stretched first to the new image dimensions,
    > >and if I show the new image before setting its dimensions, the new
    > >image is stretched first to the old image dimension before it is
    > >adjusted to its own dimension.
    > > I would like to load a new image with its own dimension at the same
    > >time. How can I do this?

    >
    > Off the top of my head:
    >
    > 1. change the image to something amorphous, change the dimensions,
    > then change to your new image. The intermediate image could be
    > a solid color (white?) or it could be some sort of swirl to give
    > the impression of an image being rotated.
    >
    > 2. change the visibility of the image to hidden, update it, then
    > set it back to visible.
    >
    > 3. rewrite the entire <img> tag with the new image and dimensions.
    >
    > Do all popular browsers allow you to change the dimensions of images
    > on the fly these days? Some older ones wouldn't allow that.
    >
    >
    >
    >
    > Do most current browsers allow you to change the dimensions of an
    > image after it's been rendered? Some older browsers won't.



    I have tried changing the visibility to hidden and then back to
    visible but its not working. I don't know how to make a swirl, but I
    would prefer not to have effects. I am firing the event onmouseover to
    show the images so I don't think its possible to write the <img> tag,
    but I would welcome your suggestion of how I can do it.

    thank you
    John, May 27, 2004
    #4
  5. John

    John Guest

    (John) wrote in message news:<>...
    > Lee <> wrote in message news:<>...
    > > John said:
    > > >
    > > >I am rotating images at one location of my web site. My problem is if
    > > >I set the width and height of the new image before I show the new
    > > >image, the old image is stretched first to the new image dimensions,
    > > >and if I show the new image before setting its dimensions, the new
    > > >image is stretched first to the old image dimension before it is
    > > >adjusted to its own dimension.
    > > > I would like to load a new image with its own dimension at the same
    > > >time. How can I do this?

    > >
    > > Off the top of my head:
    > >
    > > 1. change the image to something amorphous, change the dimensions,
    > > then change to your new image. The intermediate image could be
    > > a solid color (white?) or it could be some sort of swirl to give
    > > the impression of an image being rotated.
    > >
    > > 2. change the visibility of the image to hidden, update it, then
    > > set it back to visible.
    > >
    > > 3. rewrite the entire <img> tag with the new image and dimensions.
    > >
    > > Do all popular browsers allow you to change the dimensions of images
    > > on the fly these days? Some older ones wouldn't allow that.
    > >
    > >
    > >
    > >
    > > Do most current browsers allow you to change the dimensions of an
    > > image after it's been rendered? Some older browsers won't.

    >
    >
    > I have tried changing the visibility to hidden and then back to
    > visible but its not working. I don't know how to make a swirl, but I
    > would prefer not to have effects. I am firing the event onmouseover to
    > show the images so I don't think its possible to write the <img> tag,
    > but I would welcome your suggestion of how I can do it.
    >
    > thank you



    Is there someone out there who can help me with this problem?

    John
    John, Jun 1, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bob
    Replies:
    0
    Views:
    421
  2. Francois Lionet

    Rotating images

    Francois Lionet, May 9, 2007, in forum: Java
    Replies:
    2
    Views:
    372
    Wojtek
    May 9, 2007
  3. howdy

    rotating images with javascript prob

    howdy, Oct 24, 2003, in forum: Javascript
    Replies:
    5
    Views:
    100
    howdy
    Oct 25, 2003
  4. liz
    Replies:
    4
    Views:
    75
    Randy Webb
    Aug 7, 2004
  5. Rotating Images Javascript

    , Oct 21, 2005, in forum: Javascript
    Replies:
    2
    Views:
    90
    Dominic Myers
    Oct 21, 2005
Loading...

Share This Page